Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debug in csc.exe

129 views
Skip to first unread message

Wallace

unread,
Jun 22, 2011, 12:43:03 AM6/22/11
to
Hi,

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

Peter Duniho

unread,
Jun 22, 2011, 2:33:01 AM6/22/11
to
On 6/21/11 9:43 PM, Wallace wrote:
> [...]

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

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

0 new messages