[英]Why is my web.config being overwritten when I publish?
I'm using an ASP.NET Core 3.1 MVC website project.我正在使用 ASP.NET Core 3.1 MVC 网站项目。
web.config
set the property Copy to Output Directory
set to Do not copy
. web.config
设置属性Copy to Output Directory
设置为Do not copy
。
Yet when I publish the ASPNETCORE_ENVIRONMENT
is changed from Production
to Development
- why?然而,当我发布
ASPNETCORE_ENVIRONMENT
从Production
更改为Development
时 - 为什么?
Thanks in advance.提前致谢。
ASPNETCORE_ENVIRONMENT is an environment variable, and it's set by your publish profile. ASPNETCORE_ENVIRONMENT 是一个环境变量,它由您的发布配置文件设置。
Environment variables in Core 3.1 Core 3.1 中的环境变量
See: For Windows IIS deployments: Include the property in the publish profile (.pubxml) or project file.请参阅:对于 Windows IIS 部署:在发布配置文件 (.pubxml) 或项目文件中包含该属性。 This approach sets the environment in web.config when the project is published
此方法在项目发布时在 web.config 中设置环境
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.