2013-10-13 56 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。 –