本文介绍了生产服务器上的Azure Service Fabric缺少DLL:FabricCommon.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个actor服务,该服务在开发集群上运行.一个ASP.NET应用程序(通过IIS单独托管)连接到群集并使用参与者.效果很好.

I have created an actor service, which runs on a development cluster. An ASP.NET application (hosted separately via IIS), connects to the cluster and uses the actors. This works fine.

但是,当我将所有内容部署到生产环境时,ASP.NET应用程序将无法连接到群集,但以下情况除外.群集托管在本地(Windows 2012 R2).

But when I deploy everything to the production environment, the ASP.NET application fails to connect to the cluster with the below exception. The cluster is hosted on-premise (Windows 2012 R2).

The type initializer for 'Microsoft.ServiceFabric.Services.ServiceTrace' threw an exception.

Stacktrace:
   at Microsoft.ServiceFabric.Services.Common.FabricServiceConfig.TryGetConfigPackageObject(String configPackageName, ConfigurationPackage& package)
   at Microsoft.ServiceFabric.Services.Common.FabricServiceConfig.GetSettingsFilePath(String configPackageName)
   at Microsoft.ServiceFabric.Services.Common.FabricServiceConfig.GetConfig()
   at Microsoft.ServiceFabric.Services.Common.FabricServiceConfigSection.Initialize()
   at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Common.FabricTransportSettings.LoadFrom(String sectionName, String filepath, String configPackageName)
   at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Common.FabricTransportSettings.TryLoadFrom(String sectionName, FabricTransportSettings& settings, String filepath, String configPackageName)
   at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Common.FabricTransportSettings.GetDefault(String sectionName)
   at Microsoft.ServiceFabric.Actors.Remoting.FabricTransport.FabricTransportActorRemotingProviderAttribute.CreateServiceRemotingClientFactory(IServiceRemotingCallbackClient callbackClient)
   at Microsoft.ServiceFabric.Actors.Client.ActorProxyFactory.CreateServiceRemotingClientFactory(Type actorInterfaceType)
   at Microsoft.ServiceFabric.Actors.Client.ActorProxyFactory.GetOrCreateServiceRemotingClientFactory(Type actorInterfaceType)
   at Microsoft.ServiceFabric.Actors.Client.ActorProxyFactory.CreateActorProxy[TActorInterface](Uri serviceUri, ActorId actorId, String listenerName)
   at Microsoft.ServiceFabric.Actors.Client.ActorProxy.Create[TActorInterface](ActorId actorId, Uri serviceUri, String listenerName)

Inner Exception:
innerExceptionType: System.DllNotFoundException
innerStacktrace:
   at System.Fabric.Interop.NativeCommon.FabricGetConfigStore(Guid& riid, IFabricConfigStoreUpdateHandler updateHandler)
   at System.Fabric.Common.NativeConfigStore.CreateHelper(IFabricConfigStoreUpdateHandler updateHandler)
   at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)
   at System.Fabric.Interop.Utility.RunInMTA[TResult](Func`1 func)
   at Microsoft.ServiceFabric.Common.Tracing.Trace.InitializeFromConfigStore()
   at Microsoft.ServiceFabric.Services.ServiceTrace..cctor()
innerExceptionMessage: Unable to load DLL 'FabricCommon.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
exceptionType: System.TypeInitializationException

似乎在Web服务器(托管ASP.NET)上找不到 FabricCommon.dll .

It seems that the FabricCommon.dll could not be found on the web server (which hosts the ASP.NET).

我发现此文件是群集安装软件包的一部分.在开发计算机和群集计算机上,文件位于:C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll.但这显然不是通过客户端应用程序中的NuGet安装的依赖项.

I found that this file is part of the cluster installation package. On the development machine and cluster machines, the file is located here: C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll. But it is apparently not a dependency installed via NuGet in the client application.

我是否错过了在Web服务器上安装任何必备软件的机会?我必须手动包含DLL吗?

Do I missed to install any prerequisites on the web server? Do I have to include the DLL manually?

推荐答案

我认为您需要在Web服务器上安装Service Fabric SDK.

I think you need to install Service Fabric SDK on the web server.

请参阅以下链接: https://azure.microsoft.com/zh-我们/documentation/articles/service-fabric-get-started/

这篇关于生产服务器上的Azure Service Fabric缺少DLL:FabricCommon.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 00:07