I have a problem in csc.exe
I am trying to build an assembly through command prompt(csc.exe)
Here is simple example simulated
Source code:
static void Main(string[] args)
{
#if DEBUG
Console.WriteLine("Debug");
#endif
Console.WriteLine("Normal");
System.Threading.Thread.Sleep(2000);
}
Command:
csc.exe program.cs /debug
Then when I run the exe, it doesnt goes into the DEBUG constant
But when I build using IDE, then things are fine.
Please help.
Thanks,
Prince
The only thing that "/debug" does is cause the compiler to emit
debugging information. It doesn't control the defined compilation
symbols. For that, you need "/define".
For future reference, you should look at the documentation when a
program doesn't seem to be doing what you want:
http://msdn.microsoft.com/en-us/library/6ds95cz0.aspx
Also, you can check the build output from the IDE to see what the
command line actually used is. That would have shown you exactly what
you needed to use at the command line to reproduce what the IDE is doing.
Pete