core部署iis的 调试net_ASP.NET Core部署到IIS错误:不应在已部署的应用程序中启用开发环境...

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 page fine. I'm using Individual User Accounts Authentication. On the home page when I enter login/password and click Login button, I get the following error. I'm using the latest versions of ASP.NET Core and VS2015. I used VS2015 Publish wizard to publish the app. Everything is done on the same machine:

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.

解决方案

First, check the value of ASPNETCORE_ENVIRONMENT variable. You will have to set this environment variable to "Production" (or other environment than Development)

Otherwise, you can update web.config like this-

Refer this post for more details.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值