I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment.
<
On one project where we had 4 environments (development, test, staging and production) we developed a system where the application selected the appropriate configuration based on the machine name it was deployed to.
This worked for us because:
It worked well for us in this instance, but probably wouldn't work everywhere.