Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web.config Transforms add extra line returns where there are none

When my Web.config transforms it is adding a new line before the end value tag in my ApplicationSettings. This new line is showing up in the setting and causing an exception. Example:

Web.config:

        <setting name="FilePath" serializeAs="String">
            <value>c:\path</value>
        </setting>

Web.Debug.config:

        <setting name="FilePath" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)">
            <value>c:\path</value>
        </setting>

Published Web.config:

        <setting name="FilePath" serializeAs="String">
            <value>c:\path
            </value>
        </setting>

The end value tag being on its own line is causing problems. Does anyone know how to get it to stop doing this? Thanks.

like image 771
Billkamm Avatar asked Nov 05 '22 09:11

Billkamm


1 Answers

This is a known problem, which is fixed in VS 2010 SP1, apparently.

http://connect.microsoft.com/VisualStudio/feedback/details/544183/web-config-transform-writes-extra-line-break-spaces-to-values-elements-under-applicationsettings-section#

like image 59
dah97765 Avatar answered Nov 15 '22 12:11

dah97765