如何在本地服务结构集群中部署和访问来宾可执行文件(ASP.NET OWIN 自托管 webapi 应用程序)

How to deploy and access a guest executable(ASP.NET OWIN self hosted webapi application) in local service fabric cluster

我创建了一个 ASP.NET Owin 自托管 webapi 应用程序。以下是 owin 自托管代码片段

using Microsoft.Owin.Hosting;

namespace OwinSelfHostSample

{

    class Program

    {

        public static void Main(string[] args)

        {

            string localhost = "http://localhost:80";

            // Start OWIN host 
            using (WebApp.Start<LocalStartup>(localhost))
            {
                Console.ReadLine();
            }
        }
    }
}

我可以 运行 Owin exe 并访问我的服务端点,例如 http://localhost:80/keepalive

当我尝试按照 here 中的说明将其作为来宾可执行文件部署到本地服务结构集群时,发布成功,但我无法到达端点。我总是收到 503 服务不可用的 http 响应。事件查看器中也没有相关错误。

我的猜测是您的端点未在服务结构中正确配置。