-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web.Config formatting #233
Comments
When I updated from 4.4.0.0 to 4.4.1.0, it did not mess up the namespace portion of my web.config (thank you!). Although, it did change the file's first line from: to: |
Well, this is an all or nothing proposition. It was really NuGet's web.config transformation code that was doing this. We are now loading the web.config into an xmlDocument, making changes, and then saving with indentation enabled. This really isn't the best solution either, as it will likely reset formatting of the entire file back to the "regular" indentation, so anyone's custom formatting will disappear everywhere in the file (not just in the part we edit). This is just one of the many problems that we have to deal with when using NuGet that there is no right answer for. |
The encoding thing turned out to be a bigger problem than I first thought, so a fix for that has been added in v4.4.2. The file is now saved with the original encoding that was specified in the xml header. |
Every time I update using NuGet, my web.config gets ugly. I'd like it to not change my web.config if it already contains the right information, but in a different format.
It changes this (three nice lines):
to this (1 ugly line):
EDIT:
For some reason, my code isn't showing up when I post it. Below, I replaced the brackets with parenthesis so it will show up:
It changes this (three nice lines):
(add namespace="MvcSiteMapProvider.Web.Html" /)
(add namespace="MvcSiteMapProvider.Web.Html.Models" /)
(/namespaces)
to this (1 ugly line):
(add namespace="MvcSiteMapProvider.Web.Html" /)(add namespace="MvcSiteMapProvider.Web.Html.Models" /)(/namespaces)
The text was updated successfully, but these errors were encountered: