Bug 52696 - Friend access was granted to `System, PublicKeyToken=b77a5c561934e089', but the output assembly is named `System, Version=4.0.0.0, 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# (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2017-02-23 03:39 UTC by Alexander Köplinger [MSFT]
Modified: 2017-02-23 13:15 UTC (History)
2 users (show)

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


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

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

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:

> error CS0281: Friend access was granted to `System, PublicKeyToken=b77a5c561934e089', but the output assembly is named `System, Version=4.0.0.0, 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)

Note You need to log in before you can comment on or make changes to this bug.