Last post Sep 05, 2016 02:08 PM by PatriceSc
Aug 25, 2016 08:15 PM|jglazer63|LINK
Currently, in my web.config file I have
<general path="c:\abc\" />
I want to change "c:" to "d:" when I publish release. How do I do this in a transform. The <general> section is much much bigger so I don't want to rewrite then entire thing, just that one attribute. Can anyhow help?
Aug 26, 2016 10:43 AM|Chris Zhao|LINK
Please try to visit the link below will give you the detailed steps regarding how to transform web.config.
When you transform you just need to change the thing what you want to modify and keep the other things as it is.
Transform web.config on build
Aug 26, 2016 11:49 AM|jglazer63|LINK
I'll look. Was hoping for a simple example instead of a whole web site to browse, but thanks.,,,
... I looked at that page. Doesn't tell me anything on how to write a transform, just how to enable it. Thanks anyhow.
Aug 28, 2016 03:33 AM|Chris Zhao|LINK
The Locator attribute specifies the Web.config element or set of elements that you want to change in some way. The
Transform attribute specifies what you want to do to the elements that the Locator attribute finds.
Web.config Transformation Syntax for Web Project Deployment Using Visual Studio
For more information about Web.config File Transformations, see
Using Web.config transformations to change settings in the destination Web.config file or app.config file during deployment in the Web Deployment Content Map for Visual Studio and ASP.NET.
Aug 30, 2016 11:40 AM|jglazer63|LINK
So to change the "C:" to "D:" the syntax would be....??
Sep 05, 2016 02:08 PM|PatriceSc|LINK
Hi, likely something such as :
I scrolled down to the SetAttributes samples that tells that you can use a comma separated list of attributes, so that only those attributes are changed (and so if you have other attributes for your "general" tag in the source web.config file, they should
be left unchanged).