asp.net core 2.0发布到IIS报错解决方案

  大体来说,是环境的问题。

  第一个错误,如图:

  

    1. 查了网上说是文件夹权限的问题,依次设置了Everyone权限和IIS_IUSER权限,能勾选的都勾选了,然而并没有什么用,看来不是这个问题导致的。

    2. 项目是.net core 2.0,所以想,可能是环境问题,需要安装 AspNetCoreModule托管模块。

        >> DotNetCore.2.0.9-WindowsHosting.exe  

        >>安装完成后,使用命令重启IIS       net stop was /y 

                        net start w3svc

        >>编辑应用程序池,把.net clr版本设置为无托管代码,如下图:

            

 

        >>此时不报500.19的错误,改报

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

 

  第二个错误,502.5:

    尝试了许多方法。

    1. 在FolderProfile.pubxml文件中添加节点:

 

<PropertyGroup>
 <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> 
</PropertyGroup>

     >>重新发布后还是不行。

    2. Net Core SDK没有安装,或者版本安装错误:

        进入网站物理路径目录根目录,打开dos 输入命令,直接运行web程序:dotnet xxxweb.dll

          dotnet.exe报错,>>计算机中丢失 api-ms-win-crt-runtime-l1-1-0.dll

                                      解决方案:安装Visual C++ Redistributable for Visual Studio 2015 组件

                                                         下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=48145

                           

 

 

>>发布成功了。

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

 参考博客:https://www.cnblogs.com/eggTwo/p/9900613.html               

转载于:https://www.cnblogs.com/ZCrystal/p/10894538.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值