asp.net core 2.0發佈到IIS流程及報錯解決方案

 

我這是個新裝的服務器,沒有安裝任何軟件。html

1、發佈流程mysql

1.安裝AspNetCoreModule託管模塊,同時會自動安裝..net core runtimesql

DotNetCore.2.0.8-WindowsHosting.exewindows

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.0api

2.重啓電腦,或者使用以下命令重啓IIS瀏覽器

net stop was /y
net start w3svc

3.安裝IIS服務器

4.將項目發佈到IISapp

5.編輯應用程序池,把.net clr版本設置爲無託管代碼sqlserver

2、遇到問題ui

1.瀏覽器運行項目,報錯以下:

HTTP Error 502.5 - Process Failure

 

Common causes of this issue:
• The application process failed to start
• The application process started but then stopped
• The application process started but failed to listen on the configured port

 

Troubleshooting steps:
• Check the system event log for error messages
• Enable logging the application process' stdout messages
• Attach a debugger to the application process and inspect

這個錯誤網上有各類各樣的解決方案,可是苦苦嘗試了將近一天的時間沒有一個適合個人。如今彙總各類解決方案,可能有適合你的:

http://www.javashuo.com/article/p-fcyrcsgl-en.html

https://blog.csdn.net/CuiLanren/article/details/80777488

 

2.查看windows錯誤日誌信息以下:

Application 'MACHINE/WEBROOT/APPHOST/FORM' with physical root 'C:\fabu\' failed to start process with commandline 'dotnet .\Cloud.Boss.dll', ErrorCode = '0x80004005 : c0000135.

3.使用dotnet.exe命令dotnet d:\fabu\boss.dll運行項目,報錯以下:

---------------------------
dotnet.exe - 系統錯誤
---------------------------
沒法啓動此程序,由於計算機中丟失 api-ms-win-crt-runtime-l1-1-0.dll。嘗試從新安裝該程序以解決此問題。
---------------------------
肯定
---------------------------

3.1. 解決3的錯誤的方案是:

安裝Visual C++ Redistributable for Visual Studio 2015 組件
api-ms-win-crt-runtime組件爲 MFC 的運行時環境的庫,是用微軟的visual studio C++編譯的,底層也會用到微軟提供的C++庫和runtime庫,安裝Visual C++ Redistributable for Visual Studio 2015 組件便可解決此問題
下載地址:https://www.microsoft.com/en-us/download/details.aspx?id=48145,

若是安裝時報錯以下:

更新windows系統,或者參考文章:https://blog.csdn.net/neochan1108/article/details/78084073

 4.瀏覽器從新輸入項目地址,問題解決。

 總結

爲何我之前的服務器沒有遇到這個問題呢,

那是由於我之前的服務器都裝了sqlserver,他會自動安裝Visual C++ Redistributable for Visual Studio 2015 組件。而我這個項目用的是mysql,就沒有安裝此組件。

其實微軟官網文檔已經說明了,只是我沒有看,以下:

 

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.0

相關文章
相關標籤/搜索