2

Closed

Config transform does not appear to work on web.debug.config file

description

In the content subfolder from where the package is built, I created a file called "web.debug.config.transform". The target project does have a web.debug.config. Upon Add-Package, it outputs the following error:

_WriteError : 'xdt' is an undeclared prefix. Line 7, position 17.At C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\CodePlex Foundation\NuPack Tools\0.1\Scripts\nupack.ps1:107 char:24+ WriteError <<<< $.Exception + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_WriteError

The web.debug.config.transform file contains the following:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.serviceModel> <client> <endpoint address="http://devserver:8080/WebServices/Services/MyService.svc" bindingConfiguration="BasicHttpBinding_IMyService" xdt:Transform="SetAttributes" xdt:Locator="Match(bindingConfiguration)"/> </client> </system.serviceModel></configuration>

P.S. I tried the first element both with and without the xmlns attribute.
Closed Aug 17 at 4:31 PM by JeffHandley

comments

Haacked wrote Oct 12, 2010 at 10:11 PM

David, please investigate and report back. We need to know if we can punt this for later or need to fix for now.

dfowler wrote Oct 17, 2010 at 10:14 AM

Can you attach your package? I couldn't reproduce this with the latest bits.

dfowler wrote Oct 17, 2010 at 11:02 AM

I see an issue with these types of files, but I didn't see the error described. But fixing the issue will fix both problems.

dfowler wrote Oct 17, 2010 at 9:58 PM

Fixed in CS 0039199f1bbd.

FrMalan wrote Oct 21, 2010 at 10:10 AM

I tried with the latest source code version (set ccf8b9309e39) and it works fine.
There is however a problem after adding the package to a subversion repository. The files inside the hidden .svn folder inside the content subfolder are also added to the package which creates problems. One should be able to add folder exclusion rules.

FrMalan wrote Oct 21, 2010 at 11:10 AM

The only other thing to mention is that the web.{BuildEnvironment}.config file MUST have the namespace definition, i.e.
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
....
</configuration>

Haacked wrote Oct 21, 2010 at 4:36 PM

Regarding folder exclusion rules, I think that's something you should do when you create the package. For example, if you're using a build process to create your package, just make sure only the exact files you want included are put in the package.

However, if you feel strongly about it, feel free to open a new bug on that. :)

sanjeevkc wrote Aug 24, 2011 at 11:07 AM

<files>
<file src="NuGet\Content\web.config.transform" target="content" />
<file src="NuGet\Content\web.DIT.config.transform" target="content" />
</files>

this is my nuspec contents. but it is not updating the web.DIT.config file into the project where i install the package. please let me know what i will have to do. Actually i want to add different DB connection string for different environment like DIT/SIT/PROD.

feiling wrote Jan 7 at 12:25 AM

Fixed in changeset 36ac76d36a3bc0b9233ed3253fbf4feabdd37cfb