How to set aspnetcore_environment in publish file?

后端 未结 6 782
盖世英雄少女心
盖世英雄少女心 2020-12-28 12:13

I have ASP.NET Core application (Web Api). The documentation has explained working with multiple environments, however it failed to explain how to set aspnetcore_envir

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 12:41

    When hosting the application under IIS you can set the environment variable in web.config.

    https://docs.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module

    To generate it on publish add a web.config to the root of your project, "dotnet publish" will use this file as the basis for the one that is generated for in the publish folder. Then you can change the value in your deployment system.

    
    
    
     
       
         
           
         
       
       
    
    

提交回复
热议问题