簡體   English   中英

Azure應用服務上的Service Fabric客戶端。 無法加載DLL'FabricCommon.dll'

[英]Service Fabric Client on Azure App Service. Unable to load DLL 'FabricCommon.dll'

我在Azure上有Service Fabric,並且有Azure App Service(ASP.NET MVC網站),它是Service Fabric微服務的客戶端。

當我運行Web應用程序時,它說:無法加載DLL'FabricCommon.dll':找不到指定的模塊。 (來自HRESULT的異常:0x8007007E)

我已經看到生產服務器上的Azure Service Fabric缺少DLL:FabricCommon.dll,但是我不確定是否可以在azure App Service上安裝Service Fabric SDK。

這是我的客戶:

var factory = new CustomWcfCommunicationClientFactory<TContract>(
                CreateDefaultNetTcpBinding(),
                endpointBehaviors: new List<IEndpointBehavior> {new StarShipEnpointBehavior(up)},
                endpointIdentity: EndpointIdentity.CreateDnsIdentity("MyIdentity"),
                exceptionHandlers: new List<IExceptionHandler> {new WcfClientExceptionHandler()},
                servicePartitionResolver: ServicePartitionResolver.GetDefault());
var serviceFabricDescription = dict[typeof(TContract)];
return new WcfCommunicationClient<TContract>(
                factory,
                serviceFabricDescription.Uri,
                ServicePartitionKey.Singleton,
                listenerName: serviceFabricDescription.ListenerName);

其中“ CustomWcfCommunicationClientFactory”與標准庫“ Microsoft.ServiceFabric.Services.Wcf”中的“ WcfCommunicationClientFactory”幾乎相同,但允許我提供行為和身份

這是堆棧跟蹤:

[DllNotFoundException: Unable to load DLL 'FabricCommon.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
   System.Fabric.Interop.NativeCommon.FabricGetConfigStore(Guid& riid, IFabricConfigStoreUpdateHandler updateHandler) +0
   System.Fabric.Common.NativeConfigStore.CreateHelper(IFabricConfigStoreUpdateHandler updateHandler) +93
   System.Fabric.Interop.Utility.WrapNativeSyncInvoke(Func`1 func, String functionTag, String functionArgs) +29
   System.Fabric.Interop.Utility.RunInMTA(Func`1 func) +55
   System.Fabric.Common.Tracing.TraceConfig.InitializeFromConfigStore(Boolean forceUpdate) +133
   Microsoft.ServiceFabric.Services.ServiceTrace..cctor() +23

[TypeInitializationException: The type initializer for 'Microsoft.ServiceFabric.Services.ServiceTrace' threw an exception.]
   Microsoft.ServiceFabric.Services.Communication.Client.CommunicationClientCache`1..ctor(String traceId) +63
   Microsoft.ServiceFabric.Services.Communication.Client.CommunicationClientFactoryBase`1..ctor(IServicePartitionResolver servicePartitionResolver, IEnumerable`1 exceptionHandlers, String traceId) +283
   StarShip.Web.Logic.HelperService.CustomWcfCommunicationClientFactory`1..ctor(Binding clientBinding, IEnumerable`1 exceptionHandlers, IServicePartitionResolver servicePartitionResolver, String traceId, Object callback, ICollection`1 endpointBehaviors, EndpointIdentity endpointIdentity) +90
   StarShip.Web.Logic.HelperService.WcfHelper.GetClient(ICurrentUserProvider up) +504
   StarShip.Web.Logic.Services.<GetLocations>d__4.MoveNext() +98
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
   StarShip.Web.Logic.Services.<CreateLoginModel>d__3.MoveNext() +260
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
   StarShip.Web.Controllers.<Index>d__3.MoveNext() +215
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +93
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +30
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

為了從群集外部與SF服務進行通信,您需要在服務內部公開一個通信端點,例如WebApiWCF服務總線偵聽器

更多信息在這里

編輯:

您的代碼段使用Service Fabric Sdk(不可用)。 因此,請依靠純WCF代碼創建客戶端代理。 例如,從現有客戶端復制它。 或暴露的元數據終結像這樣並添加一個服務引用。

好的,我故事的棘手部分是,我不想向外界公開我的任何Service Fabric端點。 相反,我想直接使用VPN將Azure Web App鏈接到Service Fabric群集。 問題是,如果未安裝SDK,則無法使用服務結構類。 所以我現在使用HTTP API。 https://github.com/lAnubisl/ServiceFabricHttpApiClient

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM