Wcf 名称为';httpRequest&x27;不在场

Wcf 名称为';httpRequest&x27;不在场,wcf,azure,Wcf,Azure,我在使用Azure服务管理API时遇到了一个有趣的问题。具体地说,当我尝试任何操作时,“/”应用程序中出现“服务器错误”。 名为“httpRequest”的属性不存在。“ 这只发生在一个项目中,我不能通过创建其他项目来复制它 我曾尝试阅读Fusion日志,因为我怀疑汇编版本存在问题,但事实并非如此。 我还试着阅读参考资料,但也没用 我被困住了-有人有线索吗 <InnerException i:nil="true"></InnerException> <Mes

我在使用Azure服务管理API时遇到了一个有趣的问题。具体地说,当我尝试任何操作时,“/”应用程序中出现“服务器错误”。 名为“httpRequest”的属性不存在。“

这只发生在一个项目中,我不能通过创建其他项目来复制它

我曾尝试阅读Fusion日志,因为我怀疑汇编版本存在问题,但事实并非如此。 我还试着阅读参考资料,但也没用

我被困住了-有人有线索吗

<InnerException i:nil="true"></InnerException>
    <Message>A property with the name 'httpRequest' is not present.</Message>
<StackTrace>
Server stack trace:
    at System.ServiceModel.Channels.MessageProperties.get_Item(String name)
    at Microsoft.Toolkit.WindowsAzure.ServiceManagement.ClientOutputMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel) 
    at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
    at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
    at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeBeginService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
</StackTrace>

名为“httpRequest”的属性不存在。
服务器堆栈跟踪:
在System.ServiceModel.Channels.MessageProperties.get_项(字符串名称)中
在Microsoft.Toolkit.WindowsAzure.ServiceManagement.ClientOutputMessageInspector.BeforeSendRequest(消息和请求,IClientChannel频道)上
位于System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc&rpc)
位于System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime操作,布尔单向,ProxyRpc&rpc)
位于System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()处
位于System.ServiceModel.Channels.ServiceChannel.BeginCall(字符串操作、布尔单向、ProxyOperationRuntime操作、对象[]ins、时间跨度超时、异步回调、对象异步状态)
在System.ServiceModel.Channels.ServiceChannelProxy.InvokeBeginService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)中
位于System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage消息)
在[0]处重试异常:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
at System.Runtime.Remoting.proxy.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)

详细描述了解决方案。但是你需要一个正确的方向,这是非常难找到的。我们之前也遇到过同样的问题,所以我写了一篇博文(WCF)

总而言之,将对代码的调用包装为:

    using (new OperationContextScope((IContextChannel)channel))
    {
       // ... my code
    }

这个“频道”是什么?在尝试进行SOAP调用时,我收到了相同的错误。请查阅我在解决方案中引用的原始链接:它应该会为您提供有关该问题的更多详细信息。您的博客帖子链接已失效,这就是为什么最好在此处发布完整答案的原因。失效链接,不完整答案。