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
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.
In mono-4.0.0, C#6-style "using static" statements do not appear to be consulted if the type is in another assembly.
public static class Constants
public const long One = 1;
using static Constants;
static class Program
static void Main(string args)
With mono-4.0.0-branch 9236ac4, I get the following:
$ mcs Program.cs Constants.cs
$ mono Program.exe
$ mcs -target:library Constants.cs -out:Constants.dll
$ mcs Program.cs -r:Constants
Program.cs(7,30): error CS0103: The name `One' does not exist in the current context
Compilation failed: 1 error(s), 0 warnings
(monop shows that the contents of Constants.dll is as expected, and if you replace the Console.WriteLine call with "WriteLine(Constants.One)", it works as expected.)
This also fails in master/4fc75b3.
Fixed in master
Thanks for the quick fix. b526af0 applies cleanly to mono-4.0.0-branch too; it'd be great if the fix could be backported.
*** Bug 30755 has been marked as a duplicate of this bug. ***