WCF访问路径被拒绝 [英] WCF Access to path denied

查看:446
本文介绍了WCF访问路径被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET调用我的WCF服务。在我的服务,我访问一个文件,但我得到这个异​​常:

 的FaultException 1不是由用户code处理:访问路径C:\ Users \用户attilah \文档\ Visual Studio 2008的\项目\在\ ATT \ UploaderTemp \ attilah \ file1.pdf'被拒绝。
 

解决方案

该消息是pretty的明确 - 这是试图读取该文件的过程中是不允许这样做的。

你要知道 - 当你调用WCF服务时,对文件的访问将不会根据你自己的身份作出(如主叫方) - 它会由任 ASPNET 网​​络系统用户

是否有这些有限的系统帐户来访问该文件在磁盘上的服务器上?最有可能不是......

I'm using an ASP.NET to call my WCF service. in my service, I access a file but I get this exception :

FaultException '1 was not handled by user code : Access to the path 'C:\Users\attilah\Documents\Visual Studio 2008\Projects\at\att\UploaderTemp\attilah\file1.pdf' is denied.

解决方案

The message is pretty clear - the process that's trying to read the file is not permitted to do so.

Mind you - when you call a WCF service, the access to the file will not be made under your own identity (as the caller) - it'll be made by either the ASPNET or NETWORK SYSTEM user if your WCF service is hosted in IIS, or by the user the NT Service hosting your WCF service is running under.

Does any of those limited system account have access to that file on disk on your server?? Most likely not...

这篇关于WCF访问路径被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆