【问题标题】:How to publish a asp.net web core application on own hosting windows如何在自己的托管窗口上发布 asp.net Web 核心应用程序
【发布时间】:2018-07-13 15:53:32
【问题描述】:

我有一个可以运行 web core 2 应用程序的 windows 主机。我首先将应用程序发布到我电脑上的一个文件夹中,然后将文件移动到托管网站上的一个文件夹中。当我通过 http 访问该文件夹时,我收到以下错误消息:

 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

这是一个没有数据库的基本应用程序,它是 Visual Studio 的“Hello World”空模板。我这样做是为了测试。 网络提供商表示它不依赖于他们。我无法知道出了什么问题。有什么想法吗?

【问题讨论】:

    标签: asp.net-core publish


    【解决方案1】:

    您可以阅读此博客http://dotnet4hosting.asphostportal.com/post/How-to-Publish-ASPNET-Core-2.aspx。您似乎没有正确发布您的应用程序。

    根据我的经验,要解决上述错误,您需要将网站/项目发布为独立的应用程序。为了将其发布为独立的应用程序,请将其添加到 csproj 文件夹。

    <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.16.04-x64;</RuntimeIdentifiers>
    <SuppressDockerTargets>True</SuppressDockerTargets>
    </PropertyGroup>
    

    希望对您有所帮助!

    【讨论】:

      猜你喜欢
      • 2020-08-11
      • 2021-02-15
      • 2020-09-26
      • 1970-01-01
      • 2020-04-23
      • 2018-02-18
      • 2017-12-16
      • 2018-07-14
      • 2018-04-03
      相关资源
      最近更新 更多