ASP.NET Core deployment to IIS error: Development environment should not be enabled in deployed applications

后端 未结 8 2150
一个人的身影
一个人的身影 2020-12-02 20:05

I followed this article to deploy my ASP.NET MVC Core 1.0 app to local IIS on my Windows 10 that is using IIS 10. The application deployed successfully and it opens the home

相关标签:
8条回答
  • 2020-12-02 21:03

    First, this error occurs where you publish a web site that raises errors in the run-time. So check your code again in the pages that give this error. Then, set the value of ASPNETCORE_ENVIRONMENT variable to Production (instead of Development), you should also check the layout page and change <environment"development"> to <environment"Production">. Finally, publish your web site. This is tested in VS2017

    0 讨论(0)
  • 2020-12-02 21:03

    This might not be the case for everyone, however I was trying to deploy a "release" configuration to a server that had an environment variable of "uat". I set up a uat configuration to use with my deployment and the message no longer appeared when navigating to my site url. Long story short, just make sure your intended build configuration matches the destination server as others have alluded to above!

    0 讨论(0)
提交回复
热议问题