This document describes how to set transform config XML on Build in Visual Studio without using any Extensions
- The .csproj file will be modified.
- WebProject.csproj to see which modifications are required.
- It could begin from the web.config
- Right click on it and select Add Config Transforms
- This will make web.Config parent of web.Debug.Config and web.Release.Config
- Unload
.csprojfile and edit it. - Add
<UsingTask TaskName="TransformXML" />with the correct Assembly file (check WebProject.csproj in this gist) - Then you need to define which files to tansform: Example:
<Target Name="AfterBuild">
<TransformXml Source="web.config" Destination="web.config" Transform="web.$(Configuration).config" />
</Target>
To set attribute
debug="true":This allows you to debug the application