Bug 49139 - mcs, fails with CS1703 if there is a duplicate reference to a "reference" assembly, but csc/roslyn works
Summary: mcs, fails with CS1703 if there is a duplicate reference to a "reference" ass...
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2016-12-06 19:10 UTC by Ankit Jain
Modified: 2017-08-08 15:36 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

msbuild-csc.log (327.06 KB, application/octet-stream)
2016-12-06 19:10 UTC, Ankit Jain
msbuild-mcs.log (293.80 KB, application/octet-stream)
2016-12-06 19:10 UTC, Ankit Jain
dupe-ref-test.zip (706.99 KB, application/zip)
2016-12-06 19:13 UTC, Ankit Jain

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ankit Jain 2016-12-06 19:10:24 UTC
Created attachment 18796 [details]

`System.Security.Claims.dll` is being referenced from two different locations here:

1. from a .nuget package (System.Security.Claims)
2. from the Facades

Tool /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/mcs.exe

And that fails with:

CSC: error CS1703: An assembly `System.Security.Claims' with the same identity has already been imported. Consider removing one of the references
		../packages/System.Security.Claims.4.3.0/lib/net46/System.Security.Claims.dll (Location of the symbol related to previous error)
		/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/Facades/System.Security.Claims.dll (Location of the symbol related to previous error)

but the same thing works if compiled with csc.exe .

csc: version
mono: Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/f5fbc32 Mon Nov 14 14:10:00 EST 2016)

Steps to reproduce using the attached project, with mono 4.8.0:

1. mcs case: $ msbuild
2. csc case: $ msbuild /p:CscToolExe=csc.exe /p:CscToolPath=/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/msbuild/15.0/bin/ /p:DebugType=portable
Comment 1 Ankit Jain 2016-12-06 19:10:45 UTC
Created attachment 18797 [details]
Comment 2 Ankit Jain 2016-12-06 19:13:33 UTC
Created attachment 18798 [details]
Comment 3 Ankit Jain 2016-12-06 19:14:21 UTC
This currently blocks upstream msbuild from building with mcs .
Comment 4 Marek Safar 2017-08-08 15:36:51 UTC
It should be fixed in master