Azure Service Fabric is missing a DLL on the production server: FabricCommon.dll

I created an actor service that runs in a development cluster. An ASP.NET application (hosted separately through IIS) connects to the cluster and uses members. It works great.

But when I deploy everything in a production environment, the ASP.NET application cannot connect to the cluster with the exception below. The cluster is in place (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 

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

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, apparently, this is not a dependency installed through NuGet in the client application.

Did I skip installing any prerequisites on the web server? Should I include the DLL manually?

+5
source share
4 answers

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

See the link below: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started/

+2
source

Add the following path to the service cloth basket to the PATH environment variable:

 set PATH=%PATH%;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code 

Also set an execution policy without restrictions:

 Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser 
+2
source

It happens to me at some point on my dev machine. All I did was reinstall the Service Fabric SDK.

+1
source

In cases where you cannot install the Service Fabric SDK in the target environment, it is possible to use the Service REST API.

Here is my repo with an API client written in C # that can enable a service using this API

0
source

All Articles