当前位置: 代码迷 >> ASP.NET >> 再次提问:对路径“E:\小弟我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝
  详细解决方案

再次提问:对路径“E:\小弟我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝

热度:9115   发布时间:2013-02-25 00:00:00.0
再次提问:对路径“E:\我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝
说明:segments目录已经添加了isur_,network service,aspnet,everyone用户完全控制权限,还是报错。 
请问一下我这个最可能是哪里的设置问题,急判高手帮忙解决。如果有需要源码调试的请与我联系,谢谢。QQ:34508447

debug错误: 
  public Descriptor(FSIndexInput enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess mode) 
  : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, mode, System.IO.FileShare.ReadWrite)) 

InitBlock(enclosingInstance); 



附: 
对路径“E:\我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.UnauthorizedAccessException: 对路径“E:\我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝。 

ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。ASP.NET 有一个在应用程序没有模拟时使用的基进程标识(通常,在 IIS 5 上为 {MACHINE}\ASPNET,在 IIS 6 上为网络服务)。如果应用程序正在通过 <identity impersonate="true"/> 模拟,则标识将为匿名用户(通常为 IUSR_MACHINENAME)或经过身份验证的请求用户。 

要将 ASP.NET 访问权限授予某个文件,请在资源管理器中右击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”添加适当的用户或组。突出显示 ASP.NET 帐户,选中所需访问权限对应的框。 

源错误: 


行 712: } 
行 713: public long position; 
行 714: public Descriptor(FSIndexInput enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess mode) 
行 715: : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, mode, System.IO.FileShare.ReadWrite)) 
行 716: { 


源文件: D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Store\FSDirectory.cs 行: 714 

堆栈跟踪: 


[UnauthorizedAccessException: 对路径“E:\我的文档\Visual Studio 2005\WebSites\Search\crawled\segments”的访问被拒绝。] 
  System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +2013939 
  System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +998 
  System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114 
  Lucene.Net.Store.Descriptor..ctor(FSIndexInput enclosingInstance, FileInfo file, FileAccess mode) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Store\FSDirectory.cs:714 
  Lucene.Net.Store.FSIndexInput..ctor(FileInfo path) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Store\FSDirectory.cs:732 
  Lucene.Net.Store.FSDirectory.OpenInput(String name) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Store\FSDirectory.cs:577 
  Lucene.Net.Index.SegmentInfos.Read(Directory directory) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Index\SegmentInfos.cs:49 
  Lucene.Net.Index.AnonymousClassWith.DoBody() in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Index\IndexReader.cs:66 
  Lucene.Net.Store.With.Run() in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Store\Lock.cs:121 
  Lucene.Net.Index.IndexReader.Open(Directory directory, Boolean closeDirectory) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Index\IndexReader.cs:210 
  Lucene.Net.Index.IndexReader.Open(String path) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Index\IndexReader.cs:188 
  Lucene.Net.Search.IndexSearcher..ctor(String path) in D:\databackup\Lucene.Net-2.0\Lucene.Net-2.0\src\Lucene.Net\Search\IndexSearcher.cs:79 
  Pages_Keyword_Search.Bind() in e:\我的文档\Visual Studio 2005\WebSites\Search\Pages\Keyword\Search.aspx.cs:27 
  Pages_Keyword_Search.Page_Load(Object sender, EventArgs e) in e:\我的文档\Visual Studio 2005\WebSites\Search\Pages\Keyword\Search.aspx.cs:37 
  相关解决方案