【发布时间】:2020-01-08 19:21:55
【问题描述】:
我有 web.config 以及需要删除的这两个环境变量,请参见下面的 web.config ..
web.config
<aspNetCore processPath=".\Widgets.API.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
<environmentVariables>
<environmentVariable name="COMPLUS_ForceENC" value="1" />
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
<environmentVariable name="CORECLR_ENABLE_PROFILING" value="1" />
我正在尝试使用
删除这些变量web.Release.config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location>
<system.webServer>
<aspNetCore>
<!--remove the environment vars section in Release mode-->
<!--
Why? Because .NET Core has a bug where it adds environmentVariables section
during the build with the environment set as Development..
This obviously fails in production, which is why we remove it during
release.
-->
<environmentVariable name="COMPLUS_ForceENC" value="1" xdt:Transform="Remove" />
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" xdt:Transform="Remove" />
</aspNetCore>
</system.webServer>
</location>
</configuration>
无法使用模式“web.Release.config”转换文件“D:\Octopus\Applications\Widgets\XW QA\WidgetsAPI\2019.9.5_2\web.config”。
【问题讨论】:
-
提示: 在这个 CI+CD 时代,完全不使用配置转换并将静态配置文件放入单独的 SCM 存储库并将它们部署到合适的环境。配置文件不应受“构建”的支配
标签: .net xml visual-studio web-config web.config-transform