NickStrupat / NameOf

Provides strongly typed access to a compile-time string representing the name of a variable, field, property, method, event, enum, or type.
MIT License
20 stars 7 forks source link

Doesn't work getting name of property of interface #9

Open leonovalex opened 8 years ago

leonovalex commented 8 years ago

Name.Of((IModel x) => x.Status) is not working if interface is from other assembly.

Error   1   Fody: An unhandled exception occurred:
Exception:
Unable to cast object of type 'Mono.Cecil.FieldReference' to type 'Mono.Cecil.FieldDefinition'.
StackTrace:
   at NameOf.Fody.ModuleWeaver.<.cctor>b__43(Instruction instruction) in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.Patterns.cs:line 176
   at NameOf.Fody.ModuleWeaver.ProcessNameOfCallInstruction(Instruction instruction, ILProcessor ilProcessor) in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 163
   at NameOf.Fody.ModuleWeaver.ProcessMethod(MethodDefinition methodDefinition) in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 80
   at NameOf.Fody.ModuleWeaver.Execute() in c:\Users\nick.strupat\Documents\Visual Studio 2013\Projects\NameOf\NameOf.Fody\ModuleWeaver.cs:line 18
   at lambda_method(Closure , Object )
   at InnerWeaver.ExecuteWeavers() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 144
   at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 62
Source:
NameOf.Fody