Geeks With Blogs
Mindfully <> Creative Put your mind to it

Here’s simple code to add to a project’s “Build Events” post-build properties:

if exist "$(ProjectDir)Web.$(ConfigurationName).config" (copy "$(ProjectDir)Web.$(ConfigurationName).config" "$(ProjectDir)Web.config")

It searches for a build-type web.config, then replaces the current web.config with the build-type web.config file. Example of a build-type web.config’s

web.Release.config
web.Debug.config

This is best if you don’t want to continually set the
<compilation debug="true"> attribute or adjust any other settings like switching database connections, setting any <appSettings> properties, etc…

Posted on Friday, December 18, 2009 10:16 AM | Back to top


Comments on this post: Update web.config Debug/Release builds in Visual Studio web application projects

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Thks for this info. I love hostgator coupon for my hosting rebates.
Left by Dave on Mar 01, 2010 1:07 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Great share on these codes. - The Copywriter, Harlan Kilstein
Left by Harlan Kilstein on Mar 13, 2010 2:53 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Solid, thanks for sharing the code snippet.
Left by Simone on Oct 11, 2010 8:23 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Yes, I agree - Visual studio has its bugs and configs allright...its microsoft...Hmpf!
Left by Lån Trots Betalningsanmärkning on Nov 02, 2010 2:32 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Thanks for the tutorial, it helped me a lot
Left by refinance mortgage rates on Dec 08, 2010 7:47 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Thanks for sharing your thought and useful coding. It can help lot of peoples. Wish you good luck for your future endeavors.
Left by Ford Figo on Jan 12, 2011 9:56 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Great app, I tried it out and I am totally going to use it in future!
Left by Cloud Hosting on Mar 14, 2011 5:52 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Solid tips. Thank you very much for sharing your thought.
Left by Colorado Springs Real Estate on Mar 16, 2011 4:17 AM

# re: Update web.config Debug/Release builds in Visual Studio web application projects
Requesting Gravatar...
Solid, thanks for sharing the code snippet.
Left by uk2 hosting review on Mar 19, 2011 2:28 AM

Comments have been closed on this topic.
Copyright © Ray Linder | Powered by: GeeksWithBlogs.net