Skip to content

Conversation

mxprshn
Copy link
Member

@mxprshn mxprshn commented Oct 13, 2022

  • Introduce IAssemblyResolver interface for assembly name -> assembly path searchers; wrap existing Microsoft API searchers with it
  • Add some IAssemblyResolver with heuristics for .NET Framework dll's from NuGet packages resolving (for example, JetBrains ReSharper API)
  • Don't fail when some types cannot be resolved, work with those which can

@mxprshn mxprshn force-pushed the assembly-resolving-fixes branch from 0605ee9 to 5aee199 Compare October 13, 2022 13:41
{
foreach (var m in t.GetMethods(bindingFlags))
{
if (m.GetMethodBody() != null)
global::System.Reflection.MethodBody methodBody = null;
var hasByRefLikes = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, что по умолчанию лучше это выставить в false, и назвать "hasRefLikes", если имеются ввиду ref-like структуры

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В .NET оно называется именно "ByRefLike", поэтому название можно оставить

Comment on lines +212 to +213
methodBody = m.GetMethodBody();
hasByRefLikes = Reflection.hasByRefLikes(m);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Насколько я понял, эксепшен может произойти во время "m.GetMethodBody()", тогда логичнее вначале вычислить "Reflection.hasByRefLikes(m)", если это необходимо

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants