Link to home
Start Free TrialLog in
Avatar of Mike_Stevens
Mike_StevensFlag for United States of America

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
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
P.S.

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.
Avatar of Russ Suter
Russ Suter

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.