Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't switching to release in VS set the debug parameter to false in web.config

In VS2008 (and earlier if I'm not mistaking) I have dropdown that lets me choose between Debug and Release mode. All well.
When I switch VS to Release, the debug attribute in my web.config files isn't set to false at all though.
Is this the way it is supposed to be? I am bound to forget to set it to the correct value on deploying.. What measures should I take to make sure this is working like it should?

like image 851
Boris Callens Avatar asked Apr 23 '09 09:04

Boris Callens


3 Answers

This is one solution to this problem:

http://blog.aggregatedintelligence.com/2009/04/aspnet-never-again-fear-publishing-your.html

like image 177
BobbyShaftoe Avatar answered Sep 28 '22 05:09

BobbyShaftoe


Well your web.config would probably be different for debug and release (connection string, passwords, etc...) but if it's not, look at a postbuild event which would copy over a different file.

Also check this blog post from Scott Guthrie.

like image 33
Mladen Mihajlovic Avatar answered Sep 28 '22 06:09

Mladen Mihajlovic


Changing release mode will not change web.config, however when you build your web app, it will build the dll for only C# files in release mode where else your web.config's debug on/off is used by IIS to build debug/release version of ASPX markup files.

like image 40
Akash Kava Avatar answered Sep 28 '22 05:09

Akash Kava