开发者

Nuget with generated web.config file

For my application web.config file is generated by t4 template. And as a result my config file is nested from web.tt file:

Nuget with generated web.config file

Now when I install elmah, for example, I get following output:

PM> Install-Package elmah
Successfully installed 'elmah 1.2.0.1'.
'web.config' already exists. Skipping...
'web.config' already exists. Skipping...
Successfully added 'elmah 1.2.0.1' 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

Any ideas why it happens? I know that nuget won't update my web.tt file, but at least web.config, is it possible?

UPDATE

Some details. This 开发者_如何学编程happens because web.config file has attribute

<DependentUpon>Web.tt</DependentUpon>

in csproj file. If I remove it everything works as expected.


Doesn't your setup mean the Web.config is generated from the .tt file? If so, NuGet is probably doing this because if it makes changes to your Web.Config, they'll just be overwritten when the file is next generated from the .tt file?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜