This project is read-only.


Transformations on web.config when it has DependentUpon reference


Related Thread:

For my application web.config file is generated by t4 template. And as a result my web.config file is nested from file.
Now when I install elmah, for example, I get following output:

PM> Install-Package elmah
Successfully installed 'elmah'.
'web.config' already exists. Skipping...
'web.config' already exists. Skipping...
Successfully added 'elmah' to ProjectNameToken.Web.

And no configuration of elmah added to web.config file. I verified that elmah section is not present in solution:

Find all "elmah", Subfolders, Find Results 1, "Entire Solution", ""
Matching lines: 0 Matching files: 0 Total files searched: 101

This happens because web.config file has attribute DependentUpon:
<Content Include="Web.config">
If remove it then nuget performs required transforms. I'm using NuGet 1.3.20419.9007 version.

file attachments

Closed Jul 27, 2012 at 1:26 AM by aldion
  • transformations applied to web.config generated by
  • works when web.config has files that are dependentUpon


dfowler wrote Jun 17, 2011 at 8:13 AM

Can you provide the t4 template?

SlyFox wrote Jun 17, 2011 at 8:36 AM

Here is file

drusha wrote Jun 17, 2011 at 8:38 AM

We desperately need T4 support as well, cause we extensively use transformations in our projects and this is the only reason why we can't start using NuGet in every project.

frederikvig wrote Aug 24, 2011 at 11:26 AM

I can confirm this behavior. We have projects that have multiple configuration files that are nested (uses <DependentUpon>Web.config</DependentUpon> element) under web.config that we can't modify with NuGet XML Transforms.

dotnetjunky wrote Dec 14, 2011 at 2:36 PM

Consider doing this for 1.7

dotnetchris wrote Dec 28, 2011 at 4:45 PM

I added comments to the discussions thread. This also seems to impact usage of web.staging.config transforms that get ignored.

stimpy77 wrote Feb 23, 2012 at 5:21 PM

ditto on dotnetchris, this is a bigger problem than *.tt files, this is an issue for any custom web.{buildmode}.config as well. Please prioritize as we cannot find a reasonable workaround without hacking at the config file directly within powershell.

dotnetjunky wrote Jul 10, 2012 at 8:24 PM

bring back from backlog

dotnetjunky wrote Jul 27, 2012 at 12:05 AM

Fixed in changeset fdefd19dc13b8e5e46d7d0065876bcc

aldion wrote Jul 27, 2012 at 12:10 AM

note fixed in commit changeset fdefd19dc13b