Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add web.config transformation different from Release and Debug [closed]

I want to add a web.config transform to be used in an automatic build/deploy cycle via MSBuild. However when I use Visual Studio to add the transformations I only get Debug and Release and have no option to choose the transforms. As far as I understand I need to add a new configuration profile but I really don't need it for anything else. Do I have to do this or there is some other way to use the transformations (especially with build tasks)?

I am also worried that if I add a new profile I may break code that checks for debug configurations:

#if DEBUG

Is this constant defined in the configuration profile somewhere or it is the profile itself?

Basically my question is how to add config transforms that are not debug/release for automatic builds?

like image 712
Stilgar Avatar asked Aug 03 '11 08:08

Stilgar


People also ask

How to add Web Config transformation file?

If you have a web application project, Right-click on web. config and choose Add Config Transform. This will add any config transforms that are missing from your project based on build configurations (i.e. if you have Production and Staging build configs, both will get a transform added).

How do I enable debugging in web config?

In the Web. config file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to true. Change the debug attribute to false to disable debugging for that application.


1 Answers

The link in the other answer has lots of good details, but MS's notes on finding Configuration Manager were not useful. (at least for VS Express 2013)

This link will help you open it. Once you get Configuration Manager open, creating new configurations is fairly straight forward.

To open the Configuration Manager dialog box
•In Solution Explorer, open the shortcut menu for the solution and then choose Configuration Manager.

Edit
I later figured out why configuration manager was hiding. I had lost the "expert" setting in an upgrade. This setting is found under Tools/Settings.

like image 97
Greg Little Avatar answered Sep 20 '22 02:09

Greg Little