Dyl*_*tie 7 web-config web-config-transform nuget slowcheetah
我们使用SlowCheetah配置转换来管理配置,所以在我的每个网络应用程序中我都有:
> Web.config
> Web.debug.config
> Web.release.config
Run Code Online (Sandbox Code Playgroud)
我想包括appSetting在将被添加到时可以安装包(然后Web.release.config文件NuGet包变换元件应用时,该项目在Release模式实际上是打包)
按照用于web.config通过使用web.config.transform文件转换实际文件的方法,我尝试将一个NuGet\Content\web.release.config.transform文件添加到我的NuGet包中,如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="apiUsername" value="my_user" xdt:Transform="Replace" xdt:Locator="Match(key)" />
<add key="apiPassword" value="my_pass" xdt:Transform="Replace" xdt:Locator="Match(key)" />
</appSettings>
</configuration>
Run Code Online (Sandbox Code Playgroud)
不行.web.config文件被转换,但web.*.config文件未被修改:
Attempting to resolve dependency 'NewtonSoft.Json (? 4.5.7)'.
Successfully installed 'Newtonsoft.Json 4.5.7'.
Successfully installed ''MyProject.Package 1.0.7409-unstable'.
Successfully added 'Newtonsoft.Json 4.5.7' to FortKnox.Web.
'web.debug.config' already exists. Skipping...
'web.release.config' already exists. Skipping...
Successfully added 'MyProject.Package 1.0.7409-unstable' to MyThing.Web
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
| 归档时间: |
|
| 查看次数: |
1037 次 |
| 最近记录: |