简体   繁体   中英

Mono C# compiler response file syntax

I have a basic foundation in C#, having used it briefly at a previous job. Right now I'm working on really understanding the language and its paradigms by going through Pro C# 5.0 and the .NET 4.5 Framework . However, my main computing environment is a GNU/Linux system so I'm doing this using Mono.

That said I'm running into a problem using the mono C# compiler ( mcs ) to run a build using a response file ( .rsp ). Where can I find documentation about how mono parses these files and the syntax it expects?

Mostly I've run into not knowing how to specify a comment (the # symbol which is a comment under the Microsoft implementation seems to be interpreted as a file by mcs), and not knowing how to specify the options themselves.

# TestApp.rsp
-r:System.Windows.Forms.dll
-target:exe -out:TestApp.exe *.cs

When compiled:

$ mcs @TestApp.rsp
error CS2001: Source file `#' could not be found
TestApp.rsp(2,0): error CS1024: Wrong preprocessor directive
TestApp.rsp(2,0): error CS1525: Unexpected symbol `-'
Compilation failed: 3 error(s), 0 warnings

mcs doesn't seem to support comments. It just loads the response file line-by-line, strips any single or double quoting and processes the line as if it were passed as a command line argument. You can look at the LoadArgs function in mcs source . It would be easy to add comments, though, so you might want to submit a patch or pull request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM