Where to put global compiler directives?

  • Thread starter Thread starter Selden McCabe
  • Start date Start date
S

Selden McCabe

I would like to have a compiler directive to switch on or off some code in
several different places.

Is it possible to define a compiler directive (#define BUILD_RESOURCES)
somewhere and have it apply to all forms and classes? I tried putting it
at the top of global.asax, but that didn't work.

Thanks!
---Selden
 
Selden McCabe said:
Is it possible to define a compiler directive (#define BUILD_RESOURCES)
somewhere and have it apply to all forms and classes?

If you are using VS.NET, go to Project Properties / Configuration Properties
/ Conditional Compilation Constants.

If you are compiling from the command line use the /Define switch.

-- Alan
 
Selden McCabe said:
I would like to have a compiler directive to switch on or off some code in
several different places.

Is it possible to define a compiler directive (#define BUILD_RESOURCES)
somewhere and have it apply to all forms and classes? I tried putting it
at the top of global.asax, but that didn't work.

You need to put it in the project properties for each configuration you
want it to apply to.
 

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

Back
Top