警告 MSB3277:发现不同版本的“Microsoft.CSharp”之间存在无法解决的冲突

sjo*_*urg 5 compiler-warnings xamarin.ios xamarin.forms

我已经拖延这个构建警告很长一段时间了,我想在构建我的 Xamarin.Forms.Ios 项目时摆脱它。

我收到警告

“/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5):警告 MSB3277:发现不同版本的“Microsoft. CSharp“无法解决。当日志详细程度设置为详细时,这些引用冲突会在构建日志中列出。(MSB3277) (BB.App.iOS)”

在构建日志中我发现以下语句。

There was a conflict between "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
        "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
        References which depend on "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Microsoft.CSharp.dll].
            /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Microsoft.CSharp.dll
              Project file item includes which caused reference "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Microsoft.CSharp.dll".
                Microsoft.CSharp
        References which depend on "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
            /Users/sjorsmiltenburg/.nuget/packages/automapper/10.0.0/lib/netstandard2.0/AutoMapper.dll
              Project file item includes which caused reference "/Users/sjorsmiltenburg/.nuget/packages/automapper/10.0.0/lib/netstandard2.0/AutoMapper.dll".
                /Users/sjorsmiltenburg/.nuget/packages/automapper/10.0.0/lib/netstandard2.0/AutoMapper.dll
                /Users/sjorsmiltenburg/_Sources_BookaBooka/BB.App/BB.App/bin/Debug/netstandard2.0/BB.App.dll
Run Code Online (Sandbox Code Playgroud)

我可以在 android 上找到类似的问题,但这里的原因与 newtonsoft.json 引用旧的 CSharp.dll 有关。

我在这里读到的是,Automapper 正在引用 Microsoft.CSharp 4.7(我可以在我的主项目的 nuget 引用中找到它),但我无法弄清楚 Microsoft.CSharp 2.0.5.0 引用来自哪里。

我可以在我的主项目中深入挖掘 nuget - 参考树,但不能在我的 XF.ios 项目中深入挖掘。在我的 ios.proj 文件中,我没有找到对 CSharp.dll 的引用