Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
Developer Community or GitHub 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.
Created attachment 21953 [details]
Console and Mac projects
Apps that use Roslyn crash when trying to actually load the Microsoft.CodeAnalysis.CSharp assembly.
The reason appears to be that it wants to use System.ValueTuple, and loading *that* assembly is denied by the underlying Mono.
Console apps on the same Mono do not exhibit this problem—the "bad" SVT DLL is attempted (from the NuGet), and then the Facade from the framework is loaded instead, and things work.
Attached is a sample project and the output of `MONO_LOG_MASK=asm MONO_LOG_DLL=debug` runs of both the Mac app and the console app.
Created attachment 21954 [details]
Trace from running Mac app w/ MONO_LOG_MASK=asm MONO_LOG_LEVEL=debug
Created attachment 21955 [details]
Trace from running Console app w/ MONO_LOG_MASK=asm MONO_LOG_LEVEL=debug
Copying the correct facades in by hand from X.M fixes the issue:
`cp /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Facades/System.ValueTuple.dll ./TestRoslynApp/bin/Debug/Test\ Roslyn\ App.app/Contents/MonoBundle/`
`cp /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Facades/System.Text.Encoding.CodePages.dll ./TestRoslynApp/bin/Debug/Test\ Roslyn\ App.app/Contents/MonoBundle/`
After that, the app runs fine.
Here is an analysis of the issue -https://gist.github.com/chamons/3ad1634b2d453458c096382a77970f2b
And here is a totally hack of a possible solution - https://gist.github.com/chamons/579b408517a4546a5b2c98790ec2777f
@Marek is digging into the correction solution.
This may not make 15.2, but it is blocking Workbooks from using 15.2.
15.2 is too late. We'll backport it on 15.2 for workbooks if needed later.
I think we need some runtime support for this because linker or mkbundle could fell into same trap.
What do we need to do?
We'll try to fix it at build level which seems to me is the most general solution. I asked Ankit to work/protype the approach where msbuild checks assemblies which are copied into output folder and if one of them is blacklisted then it needs to copy it at all. I think this should cover XM case too but if not we just add extra copy step.
Ankit, we have a tool  to a build a list of these assemblies and we try to work with CoreFX folks to not expand it but what's there right now will stay there.
I just realised for the System.ValueTuple.dll special case we can just disable the remapping in the runtime, if XM correctly uses reference assemblies we'll have to do it anyway as the Mono version of System.ValueTuple won't be available.
Mono PR https://github.com/mono/mono/pull/4858
Verified with XM 126.96.36.199 and mono 188.8.131.52. Issue with System.Value.Tuple got resolved. But the test app is throwing an error that it can't load System.Text.Encoding.CodePages'.
Build Log: https://gist.githubusercontent.com/GouriKumari/b570bef07f6b913c9ff10df13fc57d56/raw/9f8df4fb26cc8c3e30f3c5b6796a1632a3abb492/gistfile1.txt
Error Log: https://gist.github.com/GouriKumari/5c0b3d89a23891fb03f9960bea8c3e96
## Test Env:
Since, the initial issue mentioned in the bug is verified fixed, I am closing this bug. Filed a new one for the issue mentioned in comment#17 : https://bugzilla.xamarin.com/show_bug.cgi?id=56574
I am trying to reproduce the original defect[ Issue with System.Value.Tuple ] on my side but, any quick help regarding steps will be beneficial.
Verified with XM 184.108.40.206.pkg and the issue is resolved. Rosyln app launches without any exception.
Build Log: https://gist.githubusercontent.com/GouriKumari/d47d35a6832c5323ecc9ddd3db0b535d/raw/6f0b39b4d325173e26969ce52d9ccf751952022a/gistfile1.txt
## Test Env: