【问题标题】:Replace appsettings and connection strings Octopus Deploy替换 appsettings 和连接字符串 Octopus Deploy
【发布时间】:2016-09-20 08:18:14
【问题描述】:

我正在使用 Octopus deploy 来替换 appsettings 和 connectionstrings

在我的 web.config 中,我有以下这些文件被排除在签入之外

<appSettings configSource="MyLocalAppconfig" > </appSettings> 
<connectionStrings configSource="MyLocalDB.config"> </connectionStrings>

然后在我的 web.release.config 中

我有以下

  <appSettings>
    <add key="AppSetting1" value=""/>
    <add key="AppSetting2" value=""/>
  </appSettings>
  <connectionStrings>
    <add name="MyDB1" connectionString=""/>
  </connectionStrings>

在 Octopus 中,我设置了同名的变量。我在部署中也有以下步骤票

但是当我部署 Octopus 时说

在 C:\Octopus\Applications\XXX\XX\1.0.1\Web.config 中找不到匹配的 appSetting、applicationSetting 或 connectionString 名称

【问题讨论】:

  • 您是否检查过这些变量的范围是您要部署到的环境?
  • 下一个测试是将这些应用设置直接添加到 web.config 中,看看会发生什么......

标签: asp.net .net octopus-deploy


【解决方案1】:

您没有使用有效的 XDT。你必须告诉它如何改变这些。在您的情况下,您想插入它们,因为它们在原始文件中不存在。

【讨论】:

    【解决方案2】:

    您确定 Web.release.config 是您的软件包的一部分吗? NuGet Package Explorer 非常方便查看包裹的内容。 (您也可以在包文件名中添加 .zip 扩展名(或将 .nupkg 重命名为 .zip),双击它就会打开)。

    也许您看到的是附带损害。没有找到 Web.release.config,所以根本没有发生任何转换......所以没有 appSettings 或 connectionStrings。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      • 2010-09-27
      相关资源
      最近更新 更多