我正在尝试创建一个Visual Studio项目模板,其中包括一个带有
在样板
以下是我从Azure Service Fabric复制的样板代码:
StatelessService
的Azure Service Fabric项目。在样板
Program
入口点代码中,我遇到了一个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;
}
}