asp.net核心开发模型

问题描述:

错误. 处理您的请求时发生错误. 开发模式 切换到开发环境将显示有关所发生错误的更多详细信息.

Error. An error occurred while processing your request. Development Mode Swapping to Development environment will display more detailed information about the error that occurred.

不应在已部署的应用程序中启用开发环境,因为它可能导致异常显示的敏感信息显示给最终用户.对于本地调试,可以通过将ASPNETCORE_ENVIRONMENT环境变量设置为Development并重新启动应用程序来启用开发环境.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.

发布iis后如何使用开发模型

how do i use the development model after publish iis

您可以尝试在web.configaspNetCore元素内设置环境变量,如下所示:

You can try setting the environment variable inside the aspNetCore element in the web.config like this:

<aspNetCore....> 
  <environmentVariables> 
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> 
  </environmentVariables>
</aspNetCore>. 

对web.config的此类更改应在发布期间保留.

Such a change to web.config should be preserved during publish.