學習采坑.這坑不解決領(lǐng)不提爾就蹦出來了! 分享一個坑!
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.
這里面的關(guān)鍵字基本都在網(wǎng)上搜索了一遍.無奈問題沒得到解決.
下面記錄歷次經(jīng)歷:
1/項目權(quán)限功能完成測試.在開發(fā)環(huán)境一切正常就是發(fā)布后(IIS windows7)怎么都登錄不了.調(diào)試卻一切正常!方法用盡,準備砸電腦!最后換一個數(shù)據(jù)請求方式.算是能登錄,
2/程序員就有強迫癥,總想著解決了. 領(lǐng)不提爾 有蹦出這個問題.又是不服網(wǎng)上方法又試一遍.最后得出的結(jié)論是請求數(shù)據(jù)格式 contentType: 'application/json' 改為 contentType: 'application/json;charset=utf-8',坑.
3/真?zhèn)€ 領(lǐng)不提爾 原以為坑算是踩平了.這又來了, 突然太突然懷疑人生了.顯然得到的答案不能解決.那就自己一行一行調(diào)試.可是調(diào)試沒反應.根本不報錯.無從下手.那就哪里出錯修哪里.
終于有了眉目,瞬間就只讀問題出在哪里了:
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 由于這個類結(jié)構(gòu)發(fā)生了改變,卻沒有遷移到數(shù)據(jù)庫.導致無法匹配.(異常捕獲)
到這里問題算是告一段落.
不曉得啥子時候還會有.有了就記錄下來.