web-config-transform

Web Config Transform not working

梦想的初衷 提交于 2019-11-27 10:54:36
In a .NET MVC 3.0 Application I have the following configuration in appSettings : web.config <appSettings> <add key="SMTPHost" value="mail.domain.com"/> <add key="SMTPUsername" value="user@gmail.com"/> <add key="SMTPPort" value="25"/> <add key="SMTPPwd" value="mypassword"/> <add key="EmailFrom" value="notific@gmail.com"/> </appSettings> For debugging, I have the following configuration transform defined: web.Debug.config <appSettings> <add key="SMTPPort" value="58" xdt:Transform="Replace" xdt:Locator="Match(key)" /> </appSettings> And I run the application in debug mode, but my SMTP port is

XDT Transform: InsertBefore - Locator Condition is ignored

我的梦境 提交于 2019-11-27 02:33:59
问题 I have a web.config file in which I need to either insert the <configSections /> element or manipulate children of that node if it already exists. If it already exists I don't want to insert it again (obviously, as it is only allowed to exist once). Normally, that would not be a problem, however: If this element is in a configuration file, it must be the first child element of the element. Source: MSDN. So if I use xdt:Transform="InsertIfMissing" the <configSections /> element will always be

MSBuild Script and VS2010 publish apply Web.config Transform

半腔热情 提交于 2019-11-26 21:21:06
So, I have VS 2010 installed and am in the process of modifying my MSBuild script for our TeamCity build integration. Everything is working great with one exception. How can I tell MSBuild that I want to apply the Web.conifg transform files that I've created when I publish the build... I have the following which produces the compiled web site but, it outputs a Web.config, Web.Debug.config and, Web.Release.config files (All 3) to the compiled output directory. In studio when I perform a publish to file system it will do the transform and only output the Web.config with the appropriate changes..

Web Config Transform not working

偶尔善良 提交于 2019-11-26 15:22:26
问题 In a .NET MVC 3.0 Application I have the following configuration in appSettings : web.config <appSettings> <add key="SMTPHost" value="mail.domain.com"/> <add key="SMTPUsername" value="user@gmail.com"/> <add key="SMTPPort" value="25"/> <add key="SMTPPwd" value="mypassword"/> <add key="EmailFrom" value="notific@gmail.com"/> </appSettings> For debugging, I have the following configuration transform defined: web.Debug.config <appSettings> <add key="SMTPPort" value="58" xdt:Transform="Replace" xdt

App.Config Transformation for projects which are not Web Projects in Visual Studio?

[亡魂溺海] 提交于 2019-11-25 22:34:41
问题 For Visual Studio 2010 Web based application we have Config Transformation features by which we can maintain multiple configuration files for different environments. But the same feature is not available for App.Config files for Windows Services/WinForms or Console Application. There is a workaround available as suggested here: Applying XDT magic to App.Config. However it is not straightforward and requires a number of steps. Is there an easier way to achieve the same for app.config files?