Domanda

I'm trying to compile a cs file that is in a sibling directory of my project but csc fails to open it. Here's a sample of the command line that triggers the issue:

csc ../test/file.cs

Csc prints this message:

error CS1504: Source file '<path to current dir>\file.cs' could not be openned

The really really strange thing is that it strips the "../test" part.

Anyone has an idea on how to make this work? thanks

È stato utile?

Soluzione

Since this is the command line, you should use backslashes to delimit the directories.

csc ..\test\file.cs

(In a C# program, it wouldn't matter if you'd use backslashes or forward slashes.)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top