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

相关文章
相关标签/搜索