我创建了一个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并联系我的服务 endpoints ,如http://localhost:80/keepalive等
当我尝试按照here中的说明将此作为来宾可执行文件部署到本地服务结构集群时,发布成功,但我无法命中 endpoints . 我总是得到503服务不可用的http响应 . 事件查看器中也没有相关错误 .
1 回答
我的猜测是你的 endpoints 没有在服务结构中正确配置 .
通过调试本地群集确保您的服务真正启动
检查 endpoints 配置 - 您是否在应用程序清单中发布了端口? https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-service-manifest-resources
请查看此文档 . 它只提到了客户可执行文件中的API,但仍然可以帮助你https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication-aspnetcore