0

我有一个 WCF 服务服务,它在本地 IIS 中托管时运行良好,但在 Azure VM IIS 中托管时会出现以下异常:

DispatchOperation requires Invoker. 
Exception Details: System.InvalidOperationException: DispatchOperation requires Invoker

堆栈跟踪 :

[InvalidOperationException: DispatchOperation requires Invoker.]
   System.ServiceModel.Dispatcher.DispatchOperationRuntime..ctor(DispatchOperation operation, ImmutableDispatchRuntime parent) +17276262
   System.ServiceModel.Dispatcher.ImmutableDispatchRuntime..ctor(DispatchRuntime dispatch) +824
   System.ServiceModel.Dispatcher.DispatchRuntime.GetRuntimeCore() +114
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpened() +520
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +766
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +260
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +742
   System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +126
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901

[ServiceActivationException: The service '/PidPlusService.svc' cannot be activated due to an exception during compilation.  The exception message is: DispatchOperation requires Invoker..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +650220
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +210733
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282

我有服务中的 svc 文件、web.config 文件和 dll。服务项目是一个类库项目,是生成 dll 的解决方案的一部分。在 Azure 中托管的代码中是否需要更改某些内容?还是配置问题?

4

1 回答 1

0

您将必须配置虚拟机以支持 WCF,就像您对本地本地 IIS 计算机所做的那样。确保在 Azure 中的 VM 上配置了这些设置。

此外,您可能需要在 Windows 功能中启用“WCF Http 激活”(.NET Framework 3.5)。如果您的目标是 .NET Framework 4.5,请确保启用了“WCF 服务”(.NET Framework 4.5 高级服务)。

于 2013-10-21T15:57:00.587 回答