8
votes

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

1
Try setting environment variable inside aspNetCore element in the web.config. Something like <aspNetCore....> <environmentVariables> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> </environmentVariables></aspNetCore>. You can set it in your project and publish-iis should preserve this. - Pawel
thanks you very much! - witson
@Pawel This should be added as the answer. - OctoCode
@OctoCode - Thanks for bringing this to my attention. I was not aware that the comment had that many upvotes - turned it to an answer. - Pawel

1 Answers

12
votes

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.