• win 10+ iis 10 部署.net core 1.1 web api


    今天上午部署了wcf,部署了好久,一直没有部署好,最后找到了dudu的部署方法,结果中午吃饭的时候成功了,这是链接:http://www.cnblogs.com/dudu/p/3328066.html

    下午部署了web api ,由于用的是core 2.0预览版1,结果部署了很久都是没有成功,报的错是:502.5,

    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

    我试了很久都没有效果,其中参考了dudu的http://www.cnblogs.com/dudu/p/6110727.html,连报的错误都一样,可是试了一番,并不和自己对症,后来用命令行执行 dotnet /WenAPI.dll

    试了之后,也是无果,于是想到了是不是版本不对,也就是windowhost和.net core 的版本不匹配,我用的windowhost版本下的是最新的1.0.4   下载地址:http://download.microsoft.com/download/3/8/1/381CBBF3-36DA-4983-BFF3-5881548A70BE/DotNetCore.1.0.4_1.1.1-WindowsHosting.exe 

    我的core开始也说了是预览版的2.0 。

    最后解决方法是:我把 core 下的 web api 换为core 1.1 之后发布之后,我先用命令行执行了一下结果成功了,

    PS C:WebAPI> dotnet .api.dll
    Hosting environment: Production
    Content root path: C:WebAPI
    Now listening on: http://localhost:5000
    Application started. Press Ctrl+C to shut down.

    于是,我又按照官网的做法,给发部了一遍,发布之后开启了目录浏览的功能,结果浏览的时候,给我报404 我也是有点蒙了,后来想了一下,既然命令行可以成功,说明我发布的是没有问题的,还有web api是没有界面的,所以浏览的时候报404也是正常的,后来我在客户端,有httpclient进行了测试,结果取到数据了。

    也就是发布成功了!!

  • 相关阅读:
    android —— textview解析html富文本
    android toolbar及可折叠标题栏
    dp——cf1327F
    cf1327D,E——组合数学
    技能表自查
    python 之禅 import this
    转--Python标准库之一句话概括
    python 爆破
    python -- 算法
    python 代码模板
  • 原文地址:https://www.cnblogs.com/qulianqing/p/7019372.html
Copyright © 2020-2023  润新知