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