web-config-transform

Different connection string for each publish profile in VS2010

末鹿安然 提交于 2019-12-19 03:25:16
问题 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;..." 回答1: This is exactly what web config transforms were created for. The link you provided in your post has a walkthrough of doing this

Web.config transformation: how to apply a transformation to all node matching a Locator expression?

我只是一个虾纸丫 提交于 2019-12-19 00:09:11
问题 I've recently discovered the web.config automatic transformation in the web deploy tool of visual studio 2010. It's working well, but I have a scenario I can't seem to get working. Assume I have the following root Web.config <services> <service name="Service1"> <endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding" contract="Service1" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> <service name="Service2">

Is there any way to do a “Replace Or Insert” using web.config transformation?

瘦欲@ 提交于 2019-12-18 09:55:45
问题 I'm using web.config transformation as described in the below post in order to generate configs for different environments. http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html I can do a "Replace" transformation by matching on the key, e.g. <add key="Environment" value="Live" xdt:Transform="Replace" xdt:Locator="Match(key)" /> And I can do "Inserts" e.g. <add key="UseLivePaymentService" value="true" xdt:Transform="Insert" /> But what I would really find

MSBuild Script and VS2010 publish apply Web.config Transform

ε祈祈猫儿з 提交于 2019-12-17 05:33:05
问题 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

Web.config transforms - surrounding elements

左心房为你撑大大i 提交于 2019-12-14 03:45:11
问题 I am using the web.config transforms available via VS2010. In this one case I'm wondering if it possible to 'surround' an element with another during transformation. Here is an example: default web.config contains: <configuration> <system.web> .... </system.web> </configuration> My transformed file should contain <configuration> <location inheritInChildApplications="false"> <system.web> ... </system.web> </location> </configuration> So essentially I want to 'wrap' the system.web element with

How do I enable IntelliSense in VS 2013 for <rewrite> in transform .config?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 03:41:59
问题 I decided I wanted to move some rewrite rules into our web.release.config and web.staging.config files in order to keep the rewrite rules relevant to the environments our different configurations run on. IntelliSense didn't like this decision and wouldn't play ball because: xdt:Transform "attribute is not declared" for the <rewrite> element. I looked at RuslanY's solution here and I considered several solutions on this site but none of them provided the solution to this particular problem in

Can't transform XML when deploying to VSTS

妖精的绣舞 提交于 2019-12-14 03:18:52
问题 For a VSTS worker role, I'm trying to build configuration transforms so I can change settings based on the environment. I created two files in my solution directory, App.dev.config and App.prod.config, which I have linked to a test project. I then used this tool to apply config transforms and generate the files App.Debug.config and App.Release.config. In my worker role's regular old app.config, I specify that app settings normally come from the App.dev.config file, so it can either remain in

CodeAssassin.ConfigTransform for of arbitrarily named config files

拈花ヽ惹草 提交于 2019-12-13 01:27:35
问题 NuGet packages such as CodeAssassin.ConfigTransform tranform web.*.config or app.*.config to web.*.config.transformed or app.*.config.transformed upon a VS build. However, what if you have config files of form {arbitrary-name}.config ? For example, MyAssembly.dll.config and its transform rulesets MyAssembly.dll.debug.config & MyAssembly.dll.release.config CodeAssassin.ConfigTransform does not appear to work for these file patterns. 回答1: If you look at the target source code it looks quite

Why am I receiving the required attribute 'name' is missing warning in my Web.Release.config XML-Document-Transform file?

三世轮回 提交于 2019-12-12 11:16:10
问题 I'm trying to remove all service endpoint mexHttpBinding nodes in my Web.Release.config file. I found this answer: (I copied from my code file, so it's actually formatted differently than the answer ) <services> <service> <endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="RemoveAll" /> </service> </services> The warning I am receiving is on the <service> node: The required attribute 'name' is missing. Do I need to add an empty string or wildcard ( if there is one )

Web.Release.Config does not work

时间秒杀一切 提交于 2019-12-12 02:42:04
问题 I have a web site I just took over and am wanting to get web transformations working. I have always had success with MVC projects doing this for debug and release but this ASP web pages application refuses to cooperate. I apologize if this is a duplicate. I see a lot of questions like this but nothing has solved my issue yet. If I press F5 and run, I get web.config settings as I expect. If I publish my "Test" profile (debug mode) I get web.Test.Config transformations as expected. If I publish