0

I'm trying to create an iOS-specific class library assembly which uses the excellent Nito.AsyncEx 3.0.0 NuGet package. When I bring in the package, the compiler flags a conflict with different versions of the same dependent assembly:

1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.IO.dll : error CS1703: An assembly with the same identity 'System.IO, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.Runtime.dll : error CS1703: An assembly with the same identity 'System.Runtime, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.
1>c:\Users\mpilot\Documents\Visual Studio 2013\Projects\IosTestClassLib\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+win8\System.Threading.Tasks.dll : error CS1703: An assembly with the same identity 'System.Threading.Tasks, Version=2.6.8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.

It looks like the Nito.AsyncEx package imports the Microsoft.Bcl package, which presumably conflicts with the mono implementation found in Xamarin.iOS.

Looking at the .nuspec file, I see the MonoTouch-related target frameworks all list Microsoft.Bcl as a dependency. The same applies to the .Net Framework 4.0 target. For projects targeting .Net 4.5, Microsoft.Bcl is not listed as a dependency (of course).

AFAIK, Xamarin's latest iOS SDK does implement all the async-await goodies found in .Net 4.5. This means the Nito.AsyncEx NuGet package should add itself to a class library targeting Xamarin.iOS as if the class lib was targeting .Net 4.5.

In fact, if I remove the Nuget package from the assembly references (and the Microsoft.Bcl references) then manually add the Nito.AsyncEx DLLs from the Nuget's net45 sub-folder, things work OK - project links and the Nito.AsyncEx functionality does work as expected - at least the part that I use.

I know this is a hack, and I don't want to do this in production code, but it tells me my initial analysis of the problem isn't totally off-base.

Am I missing something? Is there a project setting I need to tweak to get the proper package target to be deployed to my class library? Or is there something wrong with the NuGet package?

1 Answer 1

0

It turns out the problem was fixed in Microsoft.Bcl version 1.1.10. Simply updating from 1.1.8 to 1.1.10 did the trick!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.