web-config-transform

Different connection string for each publish profile in VS2010

谁都会走 提交于 2019-11-30 21:25:35
Is it possible to change connection string (or just server host) relying on selected web publish profile? Maybe using Web.config transform or someway else? I mean for profile "Test" change connection string "MyConnString" (in published Web.config) to "Data Source='example.com,14333;..." and for profile "Production" - to "Data Source=./SQLExpress;..." This is exactly what web config transforms were created for. The link you provided in your post has a walkthrough of doing this specifically for connection strings. To start with the transforms, right-click your web.config file in the project

Error doing web.config transformation for different environments

喜欢而已 提交于 2019-11-30 18:14:01
I was trying to deploy my app into different environments then i started following this how to: Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio or Visual Web Developer: Web.Config File Transformations - 3 of 12 was perfect until I clicked in Preview Transform , I received this error: Microsoft Visual Studio Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (I created just one transformation Web.DebugQA.config and of

Error doing web.config transformation for different environments

坚强是说给别人听的谎言 提交于 2019-11-30 16:50:22
问题 I was trying to deploy my app into different environments then i started following this how to: Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio or Visual Web Developer: Web.Config File Transformations - 3 of 12 was perfect until I clicked in Preview Transform , I received this error: Microsoft Visual Studio Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

How do I get an msbuild task to do config transforms on a collection of files?

≡放荡痞女 提交于 2019-11-30 07:15:59
I am trying to transform all of the web.config files in a project I have, here's a my tree structure: Transform.bat Transforms ConfigTransform.proj Web.Transform.config Website web.config Views web.config There's more web.config files, but the idea is that this will find all of them and apply the same config transform on them. I've taken a few hints from a blog post I found but I get stuck in the last step, the actual transformation. Also there's a bit of a rough part in the middle that I don't really like (I don't quite understand what I'm doing and I'm obviously doing it wrong). Here's where

Web Config Transformation to add a child element

大城市里の小女人 提交于 2019-11-29 10:32:08
问题 I've got the following configuration in web.config: <resizer> <sizelimits imageWidth="0" /> <plugins> <add name="MvcRoutingShim" /> <!--<add name="AzureReader" connectionString="DataConnectionString" /> --> <add name="DiskCache" /> <add name="PrettyGifs" /> <add name="AnimatedGifs" /> </plugins> </resizer> In web.config.Release, how can I add the AzureReader element as a child of the plugins element (effectively uncommenting out the above)? I'm familiar with how to do basic transformations

How do I get an msbuild task to do config transforms on a collection of files?

泪湿孤枕 提交于 2019-11-29 09:27:09
问题 I am trying to transform all of the web.config files in a project I have, here's a my tree structure: Transform.bat Transforms ConfigTransform.proj Web.Transform.config Website web.config Views web.config There's more web.config files, but the idea is that this will find all of them and apply the same config transform on them. I've taken a few hints from a blog post I found but I get stuck in the last step, the actual transformation. Also there's a bit of a rough part in the middle that I don

TFS 2012 and web.config transforms

孤者浪人 提交于 2019-11-28 17:08:22
问题 I am trying to have my TFS Build create the web.config transform associated with the configuration I selected for my build. When I run the build I check the web.config file no transforms have been applied. When I a publish from VS2012 the transform works correctly. I have set up TFS 2012 (Update 2), and have a separate server for builds. I don't have VS2012 installed on the build server, but I copied the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\ Web and WebApplications

XDT Transform: InsertBefore - Locator Condition is ignored

懵懂的女人 提交于 2019-11-28 09:00:00
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 inserted after any existing child elements (and there are always some), violating the above

Web Config Transformation to add a child element

梦想与她 提交于 2019-11-28 08:51:16
I've got the following configuration in web.config: <resizer> <sizelimits imageWidth="0" /> <plugins> <add name="MvcRoutingShim" /> <!--<add name="AzureReader" connectionString="DataConnectionString" /> --> <add name="DiskCache" /> <add name="PrettyGifs" /> <add name="AnimatedGifs" /> </plugins> </resizer> In web.config.Release, how can I add the AzureReader element as a child of the plugins element (effectively uncommenting out the above)? I'm familiar with how to do basic transformations but have never done this before. You can use the Insert transformation: <resizer> <plugins> <add name=

How to remove a ConnectionString using Config Transformations

自古美人都是妖i 提交于 2019-11-27 22:53:30
问题 I have a Web.config with several ConnectionStrings <connectionStrings> <add name="connStr1" connectionString="... <add name="ConnStr2" connectionString="... <add name="connStr3" connectionString="... Is there a way using config transformations to remove a specific connectionstring? Something Like: <connectionStrings> <xdt:Remove connStr2? Obviously no where near the correct syntax, but you get my drift... 回答1: From the MSDN documentation on the subject: <configuration xmlns:xdt="...">