2016-06-24 20 views
5

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?

+0

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

Trả lời

2

Tôi nghĩ bạn cần cài đặt Service Fabric SDK trên máy chủ web.

Xem các liên kết dưới đây: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started/

+0

Xin chào. Điều này giải quyết vấn đề cụ thể của tôi (thiếu DLL). Tuy nhiên tôi đã phải chuyển đổi các máy chủ web thành một máy dev. Và kết nối với cụm từ xa vẫn là một vấn đề. Trong khi chờ đợi, tôi tìm thấy [this] (http://stackoverflow.com/questions/38015934/how-to-create-actor-proxy-to-remote-service-fabric-cluster). – Henrik

1

Tôi có điều này xảy ra tại một thời điểm trong máy dev của tôi. Tất cả những gì tôi làm là cài đặt lại Service Fabric SDK.

2

Thêm đường dẫn bin Dịch vụ Vải sau để biến môi trường PATH của bạn:

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

Ngoài ra thiết lập chính sách thực hiện để hạn chế:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser 
0

Đối với trường hợp khi bạn không thể cài đặt Service Vải SDK trên môi trường đích có một tùy chọn để sử dụng Service Fabric REST API.

Đây là my repo với khách hàng API viết bằng C# mà có thể giải quyết dịch vụ sử dụng API này

Các vấn đề liên quan