• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
zcrystal
博客园    首页    新随笔    联系   管理    订阅  订阅
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               

此间不逝,岁岁年年。
posted on 2019-05-20 15:48  ZCrystal  阅读(956)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3