【发布时间】:2016-07-20 15:09:51
【问题描述】:
我正在尝试创建一个 Visual Studio 项目模板,其中包含一个带有 StatelessService 的 Azure Service Fabric 项目。
在样板代码Program EntryPoint 代码中,我得到一个FabricConnectionDeniedException。 我在哪里设置连接信息或以其他方式修复此异常?我正在针对本地集群管理器运行。我查看了各种.xml 配置文件,但什么也没看到。我需要在集群管理器中将我的应用列入白名单吗?
这是我从 Azure Service Fabric 复制的样板代码:
private static void Main()
{
try
{
// Creating a FabricRuntime connects this host process to the Service Fabric runtime.
using (var fabricRuntime = System.Fabric.FabricRuntime.Create())
{
// The ServiceManifest.XML file defines one or more service type names.
// RegisterServiceType maps a service type name to a .NET class.
// When Service Fabric creates an instance of this service type,
// an instance of the class is created in this host process.
fabricRuntime.RegisterServiceType(
"RunSetManagerServiceType",
typeof(RunSetManagerService));
ServiceEventSource.Current.ServiceTypeRegistered(
Process.GetCurrentProcess().Id,
typeof(RunSetManagerService).Name);
// Prevents this host process from terminating to keep the service host process running.
Thread.Sleep(Timeout.Infinite);
}
}
catch (Exception e)
{
// !!!!!! GETTING FabricConnectionDeniedException HERE !!!!!
ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
throw;
}
}
【问题讨论】:
标签: c# azure azure-service-fabric