【发布时间】:2011-09-16 04:16:33
【问题描述】:
对于我的应用程序,web.config 文件由t4 template 生成。因此,我的配置文件嵌套在 web.tt 文件中:
例如,现在当我安装 elmah 时,我得到以下输出:
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.
并且没有将 elmah 的配置添加到 web.config 文件中。 我验证了解决方案中不存在 elmah 部分:
Find all "elmah", Subfolders, Find Results 1, "Entire Solution", ""
Matching lines: 0 Matching files: 0 Total files searched: 101
任何想法为什么会发生?我知道nuget不会更新我的web.tt文件,但至少web.config,有可能吗?
更新
一些细节。发生这种情况是因为 web.config 文件具有属性
<DependentUpon>Web.tt</DependentUpon>
在 csproj 文件中。如果我删除它,一切都会按预期工作。
【问题讨论】:
-
您没有使用 VS 中内置的 Config Transforms 有什么原因吗?
-
是的,一些顽固的开发者:(
标签: .net powershell nuget package-managers