Warning MSB3277: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved

Viewed 865

I have been dragging around this build warning for quite some time and I would like to get rid of it when building my Xamarin.Forms.Ios project.

I get the warning

"/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3277: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277) (BB.App.iOS)"

In the build log I find the following statement.

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

I could find a similar issue on android but here the cause is related to newtonsoft.json having a reference to the old CSharp.dll.

What I read here is that Automapper is referencing Microsoft.CSharp 4.7 (which I can find in the nuget references of my main project), but I Can't figure out where the Microsoft.CSharp 2.0.5.0 reference comes from.

I can drill down the nuget - reference tree in my main project but not in my XF.ios project. In my ios.proj file i find no reference to CSharp.dll

0 Answers
Related