5

【茶包射手日記】IIS 跑 ASP.NET Core 出現 500.19 0x8007000d 錯誤

 3 years ago
source link: https://blog.darkthread.net/blog/aspnetcore-500-19-0x8007000d/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【茶包射手日記】IIS 跑 ASP.NET Core 出現 500.19 0x8007000d 錯誤-黑暗執行緒

低級錯誤一枚。

我玩 ASP.NET Core 多半是跑 VS 偵錯後丟進 Docker 跑,很久沒部署到 IIS,但方法我還記得:Publish、開 AppPool,也記得要設成「沒有受控碼」(No Managed Code) (如下圖) 參考

今天部署了一個 ASP.NET Core 網站到 IIS,打開瀏覽器想測試馬上被 500.19 0x8007000d HTTP 錯誤洗臉:

貌似 web.config 有錯,但設定來源的說明只有 -1: 0: 兩個莫名其妙的數字,下方說事件檢視器可能有線索,巡了一趟只看到幾個不知所云的警告:

該不會是 IIS 沒裝 ASP.NET Core 整合模組?不對呀,之前曾在這台 IIS 跑過 ASP.NET Core,應該有裝。先爬文看看還有什麼可能... 0x8007000d 最常見的原因是 AspNetCoreModule 沒裝好沒錯,但我明明有裝,不然以前怎麼跑的?等等... 還是檢查一下比較保險。靠杯,在 IIS 模組清單真的沒看到它!

這時我才想起來,之前移除無用 .NET Core SDK時,看到 Microsoft .NET Core 2.1.2 - Windows Server Hosting,想說是 .NET Core 2.1 舊版,順手把它移掉了。

官方文件 Host ASP.NET Core on Windows with IIS 有下載連結,重新安裝:

最新版是 5.0.4,但 IIS 模組名稱仍是 AspNetCoreModuleV2:

安裝完畢,IIS 就能正常跑 ASP.NET Core 囉~

經一事長一智,如要移除舊版 Microsoft .NET Core X - Windows Server Hosting,記得要裝新版。另外,查問題別再「記得 OOO」、「應該 XXX」了,什麼都要求眼見為憑,可省下一堆鬼打牆時間。

and has 0 comments

Comments

Be the first to post a comment

Post a comment

Comment
Name Captcha 48 - 45 =

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK