首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows上运行WCF服务时获得“访问被拒绝”的异常消息

在Windows上运行WCF服务时获得“访问被拒绝”的异常消息
EN

Stack Overflow用户
提问于 2010-07-08 22:17:41
回答 1查看 3.8K关注 0票数 0

我正在尝试构建一个Healthvault WCF web服务,它需要使用Visual 2010在C#中部署Windows的x509证书。当我在本地IIS7上调试解决方案时,我可以执行所有的函数。当我部署到Windows并尝试运行我的任何方法时,我会得到这个错误。

服务器在处理请求时遇到错误。异常消息是‘访问被拒绝。’。有关详细信息,请参阅服务器日志。异常堆栈跟踪是:

在System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object实例中,System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)的Object[]输入、Object[]和输出)( System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) ( System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) )( System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

这似乎与Healthvault代码没有任何关系,所以我假设它与WCF服务有关。我不知道我的本地dev环境和Azure之间有什么变化。无论如何,这里是我的web.config文件

代码语言:javascript
复制
<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          name="AzureDiagnostics">
          <filter type="" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
 <system.serviceModel>
   <services>
     <service name="myIHM.Healthvault">
       <endpoint address="" binding="webHttpBinding" contract="myIHM.IHealthvault" behaviorConfiguration="webHttp" />
     </service>
   </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <appSettings>
    <add key="ApplicationId" value="[my-app-id]"/>
    <add key="ShellUrl" value="https://account.healthvault-ppe.com/"/>
    <add key="HealthServiceUrl" value="https://platform.healthvault-ppe.com/platform/"/>
    <add key="AppCertSubject" value="[my-cert-subject]"/>
  </appSettings>
</configuration>

我四处寻找一些答案,但似乎找不到任何与我的处境相关的东西。有人有什么建议吗?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2010-07-26 22:58:20

需要注意的一件事是,在开发结构中运行时,您比在Cloud中拥有更多权限。因此,在开发架构中工作,然后在云中遇到权限错误,这并不少见;我知道,这是件很糟糕的事情。您可以尝试使用有免费试用的Azure诊断管理器(http://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx)获取服务器日志。这可能会为您提供更多关于失败原因的详细信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3208417

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档