Bug 40557 - C# compiler errors on assembly reference paths containing commas
Summary: C# compiler errors on assembly reference paths containing commas
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.2.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2016-04-20 15:59 UTC by Jonathan Chambers
Modified: 2016-06-02 13:12 UTC (History)
1 user (show)

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

Test case (1.07 KB, application/x-zip-compressed)
2016-04-20 15:59 UTC, Jonathan Chambers

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 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.

Related Links:

Description Jonathan Chambers 2016-04-20 15:59:29 UTC
Created attachment 15782 [details]
Test case

The C# compiler cannot handle paths containing commas. This is because some compiler options are comma separated. The compiled just does a String.Split on these values rather than treating it as proper comma separated values.

The following line will fail:

mcs "comma,comma\Program.cs" -r:"comma,comma\Library.dll"


error CS0006: Metadata file `comma' could not be found
error CS0006: Metadata file `comma\Library.dll' could not be found
Compilation failed: 2 error(s), 0 warnings

To reproduce run 'build.bat' in the attached zip file.
Comment 1 Marek Safar 2016-06-02 13:12:52 UTC
This is a feature and we are csc compatible here ;-)

The problem is that csc reserves comma as arguments separator. Hence -r:a.dll,b.dll,c.dll is same as -r:a.dll -r:b.dll -r:c.dll. We could conditionally check for existing path but that seems to me as another source of problems