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)?
我想添加一个web.config转换,通过MSBuild在自动构建/部署周期中使用。但是,当我使用Visual Studio添加转换时,我只获得调试和发布,并且没有选择转换的选项。据我所知,我需要添加一个新的配置文件,但我真的不需要它。我是否必须这样做或者还有其他方法来使用转换(特别是对于构建任务)?
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?
基本上我的问题是如何为自动构建添加不是调试/发布的配置转换?
1 个解决方案
#1
3
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)
另一个答案中的链接有很多很好的细节,但MS关于查找Configuration Manager的说明没有用。 (至少对于VS Express 2013)
This link will help you open it. Once you get Configuration Manager open, creating new configurations is fairly straight forward.
此链接将帮助您打开它。打开Configuration Manager后,创建新配置非常简单。
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.
编辑我后来想出了配置管理器隐藏的原因。我在升级中丢失了“专家”设置。此设置位于工具/设置下。
#1
3
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)
另一个答案中的链接有很多很好的细节,但MS关于查找Configuration Manager的说明没有用。 (至少对于VS Express 2013)
This link will help you open it. Once you get Configuration Manager open, creating new configurations is fairly straight forward.
此链接将帮助您打开它。打开Configuration Manager后,创建新配置非常简单。
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.
编辑我后来想出了配置管理器隐藏的原因。我在升级中丢失了“专家”设置。此设置位于工具/设置下。