简体   繁体   中英

Can I use a / rather than \ to as a path separator in csc parameters?

I am using csc directly to compile a C# application, but when I specify the source files as src/main.cs it fails.

I have realised that I need to make them src\\main.cs" Now, I am wondering if it possible to specify a source file with a / rather than a \\ .

The Windows file path separator is \\ so that is what you have to use. It would be the same for all other programs as this is defined at the OS level.

While CodeInChaos mentioned that certain Windows APIs accept / as a path seperator this will not work with a command line application such as csc.exe because it uses the / for specifying options. Supporting forward slash for file paths as well would cause ambiguity.

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