Bug 29189 - Compiling class referencing corefx facade/contract assemblies raises error "Reference to type `System.SByte' claims it is defined assembly `mscorlib,..` but couldn't be found"
Summary: Compiling class referencing corefx facade/contract assemblies raises error "R...
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2015-04-17 09:27 UTC by Alexander Köplinger
Modified: 2016-06-01 11:55 UTC (History)
1 user (show)

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

Repro code with corefx assemblies (37.71 KB, application/x-zip-compressed)
2015-04-17 09:27 UTC, Alexander Köplinger

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 Alexander Köplinger 2015-04-17 09:27:36 UTC
Created attachment 10798 [details]
Repro code with corefx assemblies

Repro code with the relevant facade/contract assemblies from CoreFx is attached.

Compiling with:

> mcs /noconfig /nostdlib /reference:System.Runtime.dll /reference:mscorlib.dll test.cs

results in:

> test.cs(9,6): error CS7069: Reference to type `System.SByte' claims it is defined assembly `mscorlib, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', but it could not be found
/home/alexander/Desktop/repro/System.Runtime.dll (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

Note that commenting the sb.Append() line makes the program compile fine on mcs as well.

csc.exe has no problem compiling this on Windows.
Comment 1 Marek Safar 2016-06-01 11:55:22 UTC
Fixed in master