简体   繁体   中英

Why is my web.config being overwritten when I publish?

I'm using an ASP.NET Core 3.1 MVC website project.

web.config set the property Copy to Output Directory set to Do not copy .

Yet when I publish the ASPNETCORE_ENVIRONMENT is changed from Production to Development - why?

Thanks in advance.

ASPNETCORE_ENVIRONMENT is an environment variable, and it's set by your publish profile.

Environment variables in Core 3.1

See: For Windows IIS deployments: Include the property in the publish profile (.pubxml) or project file. This approach sets the environment in web.config when the project is published

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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