Service Fabric Error: Not authorized to connect

Tre*_*oks 4 azure-service-fabric visual-studio-2017

I am attempting to run a Service Fabric example found here:

Service Fabric Getting Started Sample

I am loading it into Visual Studio 2017 CE. I have set the Fabric app as the startup project and it appears to build and deploy just fine.

Visual Studio 2017 CE

The Service Fabric dashboard shows everything up and running.

Fabric Dashboard

However, when I try to connect using the example WebService project I get the following error:

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()
Run Code Online (Sandbox Code Playgroud)

I've seen where people get this because they have changed the startup project to something other than GettingStartedApplication, unfortunately that's not my issue.

Hes*_*han 15

将 Service Fabric 应用程序(橙色项目)设置为启动项目而不是 .Net 项目,然后错误就会消失