Mike_Stevens
asked on
Determine if ASP.NET website project is running in development environment
Is it possible to determine if asp.net web project is running in the development environment (visual studio). In a few of the projects i have some of the asp.net mail functions settings differ depending if they are running in the IDE or production.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also check the URL. What I do is modify my web.config to reference a second .config file for appsettings. I then can compile and publish the website without publishing the appsettings.config file which makes deployment much easier. On the rare occasion that I need to add new settings I can do that manually. It's much more common for me to need to publish an update without changing the appsettings.config file.
When you switch your settings to RELEASE mode, the DEBUG flag no longer exists (provided you haven't fiddled with the project's properteis), so that makes the check true, and the mail code will be compiled at that time.