Bug 52696 - Friend access was granted to `System, PublicKeyToken=b77a5c561934e089', but the output assembly is named `System, Version=, Culture=neutral, PublicKeyToken=null'
Summary: Friend access was granted to `System, PublicKeyToken=b77a5c561934e089', but t...
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2017-02-23 03:39 UTC by Alexander Köplinger [MSFT]
Modified: 2017-02-23 13:15 UTC (History)
2 users (show)

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

repro (243.81 KB, application/zip)
2017-02-23 03:39 UTC, Alexander Köplinger [MSFT]

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 for Bug 52696 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Alexander Köplinger [MSFT] 2017-02-23 03:39:55 UTC
Created attachment 19916 [details]

Unzip attached repro, then do:

1. mcs -noconfig -nostdlib -unsafe -target:library mscorlib.cs
2. mcs -noconfig -nostdlib -unsafe -target:library -r:mscorlib.dll System.cs


> error CS0281: Friend access was granted to `System, PublicKeyToken=b77a5c561934e089', but the output assembly is named `System, Version=, Culture=neutral, PublicKeyToken=null'. Try adding a reference to `System, PublicKeyToken=b77a5c561934e089' or change the output assembly name to match it

$ mono --version
Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/ba7f169 Fri Feb  3 13:34:24 EST 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug
	LLVM:          yes(3.6.0svn-mono-master/8b1520c)
	GC:            sgen
Comment 1 Marek Safar 2017-02-23 13:15:41 UTC
This happens only with Roslyn compiler. Previous versions reported CS0281 but because Roslyn reports CS0122 only for used types/members you need to add actual internal member call to trigger this (but roslyn has a bug not reporting CS0281 there)