Conditional compilation in C# - Help

Y

Yoni

I created two projects, one web and one windows app.
The Conditional code works ONLY for the windows app:
#if (DEBUG)
MessageBox.Show ("In Debug");
#else
MessageBox.Show("Not Debug");
#endif

but NOT for the web:
===
#if (DEBUG)
Response.Write("In Debug");
#else
Response.Write("Not Debug");
#endif

What the heck is going on ?!
 
V

Vadym Stetsyak

Hello, Yoni!

Y> but NOT for the web:
Y> ===
Y> #if (DEBUG)
Y> Response.Write("In Debug");
Y> #else
Y> Response.Write("Not Debug");
Y> #endif

The problem here is that DEBUG symbol is not defined ( via /define DEBUG )

I've checked my ( VS2005 ) web project settings and didn't find a way how can a add compiler options
:8-(

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top