简体   繁体   English

使用 dotnet publish 发布多个 web.configs

[英]Publish multiple web.configs with dotnet publish

I am using Blazor WASM and I will be setting the environment variable via the web.config server header.我正在使用 Blazor WASM,我将通过web.config服务器 header 设置环境变量。 However I want to be able to transform the web.config on deployment via the Azure DevOps IIS Web deploy task.但是我希望能够通过 Azure DevOps IIS web.config部署部署时转换 web.config。 How can I get the dotnet publish command to publish both the main web.config and the transform web.Release.config如何获得dotnet publish命令来发布主要web.config和转换web.Release.config

If you just want to publish with a transformation of web.config file with dotnet publish , you can just set --configuration options for "release".如果您只想使用dotnet publish转换 web.config 文件进行发布,您只需为“发布”设置 --configuration 选项。 For example,例如,

dotnet publish --configuration Release

Build configuration transforms are run first.首先运行构建配置转换。

Besides, you can also include Profile , Environment and Custom transformations after Build configuration transforms.此外,您还可以在 Build 配置转换之后包含ProfileEnvironmentCustom转换。

More details, you can refer to below links:更多详情,您可以参考以下链接:

Transform web.config 变换 web.config

ASP.NET Web Deployment using Visual Studio: Web.config File Transformations ASP.NET Web 使用 Visual Studio 部署:Web.config 文件转换

dotnet publish Command dotnet publish 命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM