服务结构错误:无权连接

时间:2018-06-27 00:39:33

标签: visual-studio-2017 azure-service-fabric

我正在尝试运行在此处找到的Service Fabric示例:

Service Fabric Getting Started Sample

我正在将其加载到Visual Studio 2017 CE中。我已将Fabric应用程序设置为启动项目,它似乎可以很好地构建和部署。

Visual Studio 2017 CE

Service Fabric仪表板显示一切并正在运行。

Fabric Dashboard

但是,当我尝试使用示例WebService项目进行连接时,出现以下错误:

WebService> Unhandled Exception: System.Fabric.FabricConnectionDeniedException: Not authorized to connect ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071C43
WebService>    at System.Fabric.Interop.NativeRuntime.FabricEndGetNodeContext(IFabricAsyncOperationContext context)
WebService>    at System.Fabric.FabricRuntime.NativeFabricRuntimeFactory.GetNodeContextEndWrapper(IFabricAsyncOperationContext context)
WebService>    at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
WebService>    --- End of inner exception stack trace ---
WebService>    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
WebService>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
WebService>    at Microsoft.ServiceFabric.Services.Runtime.RuntimeContext.<GetOrCreateAsync>d__14.MoveNext()
WebService> --- End of stack trace from previous location where exception was thrown ---
WebService>    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
WebService>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
WebService>    at Microsoft.ServiceFabric.Services.Runtime.ServiceRuntime.<RegisterServiceAsync>d__0.MoveNext()
WebService> --- End of stack trace from previous location where exception was thrown ---
WebService>    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
WebService>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
WebService>    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
WebService>    at WebService.Program.Main()

我已经看到人们从哪里得到了,因为他们将启动项目更改为GettingStartedApplication以外的其他项目,不幸的是,这不是我的问题。

2 个答案:

答案 0 :(得分:0)

在浏览WebService web.config时,我发现了用于连接到示例应用程序的端口(端口8081)。我试图以调试模式启动WebService的实例(不完全了解该示例的工作原理),这就是为什么我收到错误消息的原因。希望这会对别人有所帮助。

答案 1 :(得分:0)

将Service Fabric应用程序而不是Service Fabric服务设置为启动项目,错误将消失