I'm having a puzzling problem with my web.config
file on Visual Studio 2015. I open the project, open the web.config
file and update a connection string to point to a different database source. I save the change and then close the web.config
file. If I open back up the web.config
file, the updates that I made are still there. But after I do a build, if I open the web.config
file my update has reverted to what was there previously. Any ideas why?
I had the same issue. Turns out there was a modification to the default setup in my .csproj file...
<Target Name="BeforeBuild">
<TransformXml Source="Web.Template.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
</Target>
This generates the web.config file at Build time based on Web.debug.config, Web.release.config, etc.
As described in this article: http://www.kongsli.net/2012/01/13/enabling-web-transforms-when-debugging-asp-net-apps/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With