9

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

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.

how do i use the development model after publish iis

witson
  • 1,063
  • 2
  • 9
  • 6

1 Answers1

13

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>. 

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

Pawel
  • 31,342
  • 4
  • 73
  • 104
  • 1
    Where should the `web.config` file be located in the project? – craig Dec 11 '17 at 18:19
  • 2
    In the application root – Pawel Dec 11 '17 at 23:07
  • 3
    MMM, there is no web.config in new asp.net core projects, instead there are appsettings.json – Ayyash Feb 14 '18 at 07:14
  • 1
    https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?tabs=aspnetcore2x section "web.config" - web.config is not for the app but for IIS and needed when you use IIS as a reverse proxy for your ASP.NET Core app. – Pawel Feb 14 '18 at 07:20