【问题标题】:Moving WCF service to Azure VM将 WCF 服务移动到 Azure VM
【发布时间】:2013-10-13 10:02:42
【问题描述】:

我有一个 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 中托管的代码是否需要更改?还是配置问题?

【问题讨论】:

    标签: wcf iis azure azure-virtual-machine


    【解决方案1】:

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

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

    【讨论】:

    • 感谢您的回复,很抱歉回复晚了,但我仍然面临这个问题。因为我使用的是 WS2012,所以我已经通过服务器管理器启用了所有必需的功能/角色。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-04
    • 1970-01-01
    • 2017-09-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多