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

1.3k views Asked by At

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

1

There are 1 answers

4
marcind On BEST ANSWER

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.