0

I am trying out Fody for a Xamarin Forms app. However, I keep getting the following issue

Error

Now I tried the same code in a .NET console app and everything works like a charm.

Looking into the source code for MethodDecorator.Fody, it seems to be an issue with the following line in Reference.cs

public ReferenceFinder(ModuleDefinition moduleDefinition) {
            this.moduleDefinition = moduleDefinition;
            var mscorlibAssemblyReference = moduleDefinition.AssemblyReferences.First(a => a.Name == "mscorlib"); //Issue here
            this.mscorlib = moduleDefinition.AssemblyResolver.Resolve(mscorlibAssemblyReference).MainModule;
        }

Any pointers as to what I am doing wrong? I have attached the sample project here

4

1 回答 1

1

看起来您没有参考 mscorlib 或 Xamarin 中的命名不同。您需要找到一个包含异常等基本类型的程序集。一旦你知道这个库是如何命名的,你需要在 ReferenceFinder 的 this.mscorlib 中存储对它的引用。

于 2016-07-21T09:57:00.763 回答