2013-10-13 55 views
0

我有一个运行良好,而在本地IIS托管,而是给出了一个蓝色的VM IIS托管时,下列异常的WCF服务的服务:移动WCF服务Azure的VM

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中托管代码时是否需要更改某些内容?或者它是一个配置问题?

回答

0

您必须将虚拟机配置为支持WCF,就像您使用本地内部部署IIS计算机一样。确保在Azure中的虚拟机上配置了these settings

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

+0

感谢您的回复,并很抱歉回复迟到,但我仍然面临这个问题。我通过服务器管理器启用了所有必需的功能/角色,因为我使用的是WS2012。 –