Search

Bad XML transformation in generated web.config when I publish or deploy a package by ShadoFil

Closed
as By Design Help for as By Design

1
0
Sign in
to vote
Type: Bug
ID: 777479
Opened: 1/25/2013 1:57:50 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Hello,

I use several build configurations. The XML-translation works very well in Visual Studio for my web project. The web.config generated is good when I preview xml transformation in Visual Studio, but :
- there is no xml transformation when I publish the web project
- there is xml transformation when I build a deployment package, but with a bad xml transformation. I have $(ReplacableToken_xxx)" instead of the good value :

<connectionStrings>
    <add name="DoryConnectionString"
         connectionString="$(ReplacableToken_DoryConnectionString-Web.config Connection String_0)"
         providerName="System.Data.SqlClient"/>
</connectionStrings>

Here is my xml-transformation :

<connectionStrings>
    <add connectionString="Data Source=MyDB\BE,1433; Initial Catalog=MyDB;Integrated Security=SSPI" xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Condition(@name='MyConnectionString')"/>
</connectionStrings>

Thank you for your help.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

In a web project, add web.config for each build configuration
Use this xml-transformation in a web.BuildConfigurationName.config

<connectionStrings>
    <add connectionString="Data Source=MyDB\BE,1433; Initial Catalog=MyDB;Integrated Security=SSPI" xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Condition(@name='MyConnectionString')"/>
</connectionStrings>

Check the preview of the XML trnasformation to see it is good.
On the project web, do a "Build deployment package"

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

French

Actual results

In the generated Web.config in the deployment package, I have the key $(ReplacableToken_xxx) not replaced :

<connectionStrings>
    <add name="DoryConnectionString"
         connectionString="$(ReplacableToken_DoryConnectionString-Web.config Connection String_0)"
         providerName="System.Data.SqlClient"/>
</connectionStrings>

Expected results

In the generated Web.config in the deployment package, I have a good web.config :

<connectionStrings>
    <add name="MyConnectionString"
         connectionString="Data Source=MyDB\NEMO_BE,1433; Initial Catalog=MyDB;Integrated Security=SSPI"
         providerName="System.Data.SqlClient"/>
</connectionStrings>
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/13/2013 at 9:40 PM
Hi ShadoFil, thanks for the report here. I have looked at this and the behavior you are seeing is by design. You can control this on a per-profile basis if you like. For more info see my blob post for more details at http://sedodream.com/2010/11/11/ASPNETWebApplicationPublishPackageTokenizingParameters.aspx.

Thanks,
Sayed Ibrahim Hashimi | http://msbuildbook.com/
Posted by Microsoft on 2/1/2013 at 1:57 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 1/25/2013 at 2:49 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.