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.
Get Mono master and try to create a new project targeting .NET 4.5. MD uses dmcs compiler which is 4.0 bound and therefore fails to compile any async code.
Pretty sure I gave you a patch for this a while back, but I don't recall what happened. If it worked for you, do you still have it?
Found that patch: http://mjhutchinson.com/files/temp/md-mcs-corlib.diff
Yes, this works now.
Although it should explicitly reference mscorlib and not to depend on mcs to reference 4.5 mscorlib which will break once .net next is out.
It does explicitly reference corlib, doesn't it? That's what the first hunk of the patch does.
I could not see any mscorlib reference in log MD shows when calling mcs
Does the target framework definition XML file include corlib in its list of assemblies?
FrameworkList.xml contains only single line with path to all assemblies
Okay, so it's relying on the fallback that enumerates all dll files from that directory. I assume that mscorlib.dll is present in that directory?
Maybe our logic for looking up the corlib from the framework definition is buggy. Does code completion show you members from the new corlib?
Yes, mscorlib.dll is present, otherwise I could not compile the code. code completion is also working for new mscorlib.
The compiler arguments as logged by MD are
*** Bug 2042 has been marked as a duplicate of this bug. ***
It seems the patch was reverted:
Jeff, how did this break MonoTouch?
New patch, can you try this please?
The patch is wrong it should have
+ corlib = project.AssemblyContext.GetAssemblyLocation (corlib, project.TargetFramework);
+ if (corlib != null && !alreadyAddedReference.Contains (corlib))
+ corlibRef = " \"/r:" + corlib + "\" ";
+ sb.AppendLine ("-nostdlib");
instead or you cannot compile mscorlib.dll itself
And with that change it works?
Wait, shouldn't you just set nostdlib when building mscorlib itself?
Actually, that's a special case, when building mscorlib you should set
in your project configuration.
I updated the patch to error out when it can't find mscorlib.
I also filed bug 4835 for UI for the NoStdLib option, but you can manually edit it into your csproj for now.
Committed with cleanup.