[英]Windows Service Hosted WCF Service Getting “Access Denied” When Trying To Read a File
[英]Getting 'Access is Denied' exception message when running WCF service on Windows Azure
我正在尝试构建一个Healthvault WCF Web服务,该服务需要使用Visual Studio 2010在C#的Windows Azure上部署x509证书。在本地IIS7上调试解决方案时,我可以执行所有功能,没有问题。 当我部署到Windows Azure并尝试运行任何方法时,都会出现此错误。
服务器在处理请求时遇到错误。 异常消息为“访问被拒绝”。 有关更多详细信息,请参见服务器日志。 异常堆栈跟踪为:
在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(在System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例,Object []输入,Object []&输出)在System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&rpc)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5( System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&rpc)位于System.ServiceModel.Dispatcher.MessageRpc.Process(布尔isOperationContextSet)
这似乎与Healthvault代码没有任何关系,所以我假设它与WCF服务有关。 我不知道本地开发环境和Azure之间有什么变化。 无论如何,这是我的web.config文件
<?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>
我到处寻找一些答案,但似乎找不到与我的情况有关的任何东西。 有人有什么建议吗? 谢谢。
要注意的一件事是,与在Cloud Fabric中相比,在Development Fabric中运行时您具有更多的权限。 因此,让事情在开发结构中运行然后在云中遇到权限错误并不少见。 我真是个无赖。 您可以尝试使用例如具有免费试用版的Azure Diagnostics Manager( http://www.cerebrata.com/Products/AzureDiagnosticsManager/Default.aspx )获取服务器日志。 这可能会为您提供有关失败原因的更多详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.