由於net core在IIS上運行需要安裝對應的Hosting文件,以前的服務器是windows server 2016 安裝過程中沒有此問題。此次客戶提供的是windows server 2012 r2服務器。
net core runtime基於vc_redist.x64運行的,所以也就出現了此類錯誤需要安裝vc_redist.x64才能在iis上運行netcore項目
vc_redist.x64下載地址: https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=48145
安裝vc_redist.x64.exe 可能出現無法安裝,錯誤如下:
這是由於windows server2012 R2需要安裝補丁
這些 KB 必須按以下順序安裝:(clearcompressionflag.exe、KB2919442、KB2919355、KB2932046、KB2959977、KB2937592、KB2938439、KB2934018) 安裝過程中需要多次重啟生效。
在安裝vc_redist.x64.exe)
最后在安裝dotnet-hosting軟件即可。