简体   繁体   English

使用自托管的Azure Service Fabric调用Web API时出错

[英]Error when calling Web API with self-hosted Azure Service Fabric

I am using a new Azure Service Fabric project. 我正在使用一个新的Azure Service Fabric项目。 The project contains 2 statefull services as shown in the below image: 该项目包含2个statefull服务,如下图所示:

Visual Studio中的解决方案树

When I run the application, the explorer is shown successfully as below: 当我运行该应用程序时,资源管理器成功显示如下:

服务结构浏览器

But when I try to hit my API, http://localhost:19080/api/values , I get the below Invalid argument error. 但是当我尝试访问我的API http:// localhost:19080 / api / values时 ,出现以下Invalid argument错误。 It does not hit the controller: 它不会命中控制器:

无效的参数错误消息

Kindly advise how to solve this error. 请告知如何解决此错误。

Port 19080 is used by the Service Fabric explorer . Service Fabric资源管理器使用端口19080。 You should choose a different port to run your own service on. 您应该选择其他端口来运行您自己的服务。

As LoekD mentioned, port 19080 is used by the Service Fabric explorer. 如LoekD所述,Service Fabric资源管理器使用端口19080。 You can find the actual port of your application in ServiceManifest.xml of API project. 您可以在API项目的ServiceManifest.xml中找到应用程序的实际端口。 There should be the section Resources with Endpoints like: 应该有“具有端点的资源”部分,例如:

<Resources>
 <Endpoints>
   <Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="8315" />
 </Endpoints>
</Resources>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Service Fabric 中运行 Azure DevOps 自托管构建代理时“无法解析远程名称” - “The remote name could not be resolved” when running an Azure DevOps self-hosted build agent in Service Fabric 将Asp.Net Web Api自托管控制台应用程序发布为Azure Webjob - Publish an Asp.Net Web Api Self-hosted console application as Azure Webjob 无法访问Azure虚拟机上的自托管WCF服务 - Unable to access a self-hosted WCF service on azure virtual machine 将自托管建筑代理重定向到 Azure Devops 服务 - Redirect Self-Hosted Building Agent to Azure Devops Service Azure Web作业中的Signalr自托管集线器是否需要提升? - Signalr self-hosted Hub in an Azure Web Job requires elevation? 在Azure Web Apps中运行自托管OWIN应用程序 - Run self-hosted OWIN application in Azure Web Apps “创建管道时出错。” 在 Azure 管道自托管代理中运行 powershell 脚本时 - "An error occurred while creating the pipeline." when running powershell script in Azure pipeline self-hosted agent Azure Purview & 自托管集成运行时 - Java 未找到错误 - Azure Purview & Self-hosted integration runtime - Java not found error 将OWIN自托管Service Fabric应用程序部署到云后的端点 - Endpoint after deploying an OWIN self-hosted Service Fabric application to the cloud 将自托管的SignalR后端部署到Azure - Deploy a self-hosted SignalR backend to Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM