Bug 43305

Summary: Standard Library dependency error on Xamarin Studio
Product: [Mono] Compilers Reporter: NicolasDorier <nicolas.dorier>
Component: C#Assignee: Marek Safar <masafa>
Status: VERIFIED FIXED    
Severity: normal CC: gregm, masafa, mono-bugs+mono, mono-bugs+monodevelop, sachins
Priority: ---    
Version: 4.4.2 (C7SR1)   
Target Milestone: 4.6.0 (C8)   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description NicolasDorier 2016-08-12 13:57:07 UTC
On Xamarin Studio only (works fine on Visual Studio), a reference to a package depending on .NET Standard Library 1.6 create compile error.

Reproduction:

1. Create a new Xamarin IOS Project
2. Reference NBitcoin through nuget (https://www.nuget.org/packages/NBitcoin)
3. Use the following code somewhere: "NBitcoin.Protocol.Node.ConnectTo(Network.Main, "1.2.3.4");"
4. Compile.

Result:

Compile error: "CSC: error CS1705: Assembly `NBitcoin, Version=3.0.0.47, Culture=neutral, PublicKeyToken=null' depends on `System.Net.Sockets, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version number than referenced assembly `System.Net.Sockets, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'"

Expected:

Should compile fine.

Xamarin on Visual Studio does not have this issue, no issue at compile time and no issue at runtime.
Comment 1 Marek Safar 2016-08-12 17:36:38 UTC
Fixed in master and Mono 4.6
Comment 2 NicolasDorier 2016-08-13 01:34:38 UTC
So how can I solve my problem now ? waiting for 6.0.3 and update ?
Comment 3 Marek Safar 2016-08-15 08:31:02 UTC
You install Mono 4.6 preview (e.g. by switching to alpha channel in XS)
Comment 5 NicolasDorier 2016-08-23 08:58:35 UTC
I updated to 6.1.0.0 (5345) by switching to beta project, my project still do not compile. :(
Comment 6 NicolasDorier 2016-08-23 09:04:09 UTC
By creating a new project, it seems to compile fine. Old project do not.
Comment 7 NicolasDorier 2016-08-23 09:28:30 UTC
I needed to activate the linker on framework, else it asked my IOS SDK 10.0 shipped with XCode 8.0 which is not out...

There is still warning in my old project about assebmly reference incompatibilities.