Tôi đã tạo một dịch vụ diễn viên, chạy trên một cụm phát triển. Một ứng dụng ASP.NET (được lưu trữ riêng thông qua IIS), kết nối với cụm và sử dụng các tác nhân. Điều này hoạt động tốt.Dịch vụ Azure Vải thiếu DLL trên máy chủ sản xuất: FabricCommon.dll
Nhưng khi tôi triển khai mọi thứ vào môi trường sản xuất, ứng dụng ASP.NET không kết nối được với cụm có ngoại lệ bên dưới. Cụm được lưu trữ tại chỗ (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
Dường như FabricCommon.dll không thể được tìm thấy trên máy chủ web (nơi tổ chức các ASP.NET).
Tôi thấy rằng tệp này là một phần của gói cài đặt cụm. Trên máy phát triển và máy nhóm, tệp được đặt tại đây: C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll
. Nhưng nó rõ ràng không phải là một sự phụ thuộc được cài đặt thông qua NuGet trong ứng dụng khách.
Tôi có bỏ lỡ cài đặt bất kỳ điều kiện tiên quyết nào trên máy chủ web không? Tôi có phải bao gồm DLL theo cách thủ công không?
Các lỗi được mô tả xảy ra, khi tôi cố gắng để tạo ra một ActorProxy. Nhưng trong khi chờ đợi (nhờ vào bài viết này: http://stackoverflow.com/questions/38015934/how-to-create-actor-proxy-to-remote-service-fabric-cluster) Tôi đã học được, bằng cách sử dụng một ActorProxy từ một ứng dụng khách bên ngoài cụm không hoạt động tốt. Sử dụng dịch vụ WebAPI không quốc tịch trong cùng một ứng dụng SF là một thay thế (như được hiển thị ở đây: https://github.com/Azure-Samples/service-fabric-dotnet-web-reference-app). – Henrik