Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ASP承载的web服务中的FileStream访问被拒绝_Asp.net_Wcf_File - Fatal编程技术网

Asp.net ASP承载的web服务中的FileStream访问被拒绝

Asp.net ASP承载的web服务中的FileStream访问被拒绝,asp.net,wcf,file,Asp.net,Wcf,File,我有以下几点 //get the data as a string. using (FileStream fs = File.Open(location, FileMode.Open)) using (StreamReader reader = new StreamReader(fs)) { rawData = reader.ReadToEnd(); } 在WCF主机的web配置中 <authentication mode="Windows"/> <iden

我有以下几点

//get the data as a string.
 using (FileStream fs = File.Open(location, FileMode.Open))
 using (StreamReader reader = new StreamReader(fs))
 {
     rawData = reader.ReadToEnd();
 }
在WCF主机的web配置中

<authentication mode="Windows"/>
<identity impersonate ="true"/>
但是我得到了这个错误

访问路径“D:\some dir\rules.txt”

中的主机托管在IIS 6中,使用VirDir,annon访问帐户为我,rules.txt具有我的完全访问权限

我错过了什么。我也给了每个人访问权限,但没有运气。

解决了

已授予访问网络服务帐户的权限