The Development environment shouldn't be enabled for deployed applications

学习采坑.这坑不解决领不提尔就蹦出来了! 分享一个坑!
Error.
An error occurred while processing your request.
Request ID: 0HLQI69HED3NT:00000008

Development Mode
Swapping to the Development environment displays detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

这里面的关键字基本都在网上搜索了一遍.无奈问题没得到解决.
下面记录历次经历:
1/项目权限功能完成测试.在开发环境一切正常就是发布后(IIS windows7)怎么都登录不了.调试却一切正常!方法用尽,准备砸电脑!最后换一个数据请求方式.算是能登录,
2/程序员就有强迫症,总想着解决了. 领不提尔 有蹦出这个问题.又是不服网上方法又试一遍.最后得出的结论是请求数据格式 contentType: 'application/json' 改为 contentType: 'application/json;charset=utf-8',坑.
3/真个 领不提尔 原以为坑算是踩平了.这又来了, 突然太突然怀疑人生了.显然得到的答案不能解决.那就自己一行一行调试.可是调试没反应.根本不报错.无从下手.那就哪里出错修哪里.
终于有了眉目,瞬间就只读问题出在哪里了:

 InOrder = await _context.InOrder
                .Include(p => p.Partner)
                .Include(p => p.Plan)
                .Include(p => p.User)
                .Include(p=>p.InClass).FirstOrDefaultAsync(m => m.ID == id);

Partner 由于这个类结构发生了改变,却没有迁移到数据库.导致无法匹配.(异常捕获)
到这里问题算是告一段落.
不晓得啥子时候还会有.有了就记录下来.

你可能感兴趣的:(The Development environment shouldn't be enabled for deployed applications)