MdotButler
Programmer
This is a question more about the test environment using VS 2008 than ASP.NET but this seemed the best place to ask the question. I know this is something everyone has done in one way or another, but what I am looking for is a better solution than I currently use.
Currently I keep the connection string, SMTP server settings, debug mode, custom 404 error screens and such in the WEB.CONFIG file. When testing I alter this file to the test settings, and then alter it back to the production settings before uploading to the production server. My fear is that I publish the test WEB.CONFIG file to the production server or use the production settings in test mode. I also encrypt various sections which even complicates the switch back and forth.
I have thought about putting a hook into the masterpage or my login script to check for something and alter the WEB.CONFIG settings appropriately. For instance keep two connection strings and when in test mode, overlay the production string with the test string. Don't know what to check for to detect "Test Mode", or if everything in the config file is updateable.
Has anyone devised a better method they wish to share?
TIA
Mark
Currently I keep the connection string, SMTP server settings, debug mode, custom 404 error screens and such in the WEB.CONFIG file. When testing I alter this file to the test settings, and then alter it back to the production settings before uploading to the production server. My fear is that I publish the test WEB.CONFIG file to the production server or use the production settings in test mode. I also encrypt various sections which even complicates the switch back and forth.
I have thought about putting a hook into the masterpage or my login script to check for something and alter the WEB.CONFIG settings appropriately. For instance keep two connection strings and when in test mode, overlay the production string with the test string. Don't know what to check for to detect "Test Mode", or if everything in the config file is updateable.
Has anyone devised a better method they wish to share?
TIA
Mark