访问被拒绝到Web应用程序的根 [英] Access Denied to Root of Web Application

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

问题描述





我的本地IIS 7.5服务器上运行了一个网站。该站点有两个类库,称为 LibA LibB 。两者都被复制到构建时的同一子文件夹。 LibA 写入网站根目录中的文本文件。这很好用。但是,当 LibB 引发一个事件,该事件触发对 LibA 中相同函数的调用以写入同一文本文件时,它会失败,并显示一个例外,即访问该文件。文件被拒绝。



据我所知,这两个库都应加载到同一个AppDomain中,所以我不明白为什么一个库有权限对方没有。而且,鉴于实际文件编写始终由 LibA 完成,我不明白为什么需要不同的权限。



我不知道这里发生了什么。感谢任何帮助。





亲切的愿望,Patrick

解决方案

< blockquote>这可能听起来像一个愚蠢的问题,但你的代码是否在尝试再次打开之前关闭文件??



有时候拒绝访问没有任何内容完全有安全感。该文件可以被进程锁定,无论是您自己的还是不同的,您都会收到此消息。


尝试将Domain Account设置为ApplicationPoolIdentity。


Hi,

I have a website running on my local IIS 7.5 server. The site has two class libraries, call them LibA and LibB. Both are copied to the same sub-folder on build. LibA writes to a text file in the root directory of the website. This works fine. However, when LibB raises an event, which triggers a call to the same function in LibA to write to the same text file, it fails with an exception which says access to the file is denied.

As far as I understand it, both these libraries should be loaded into the same AppDomain, so I don''t understand why one library has permissions that the other doesn''t. And, given the fact that the actual file writing is always done by LibA, I don''t understand why different permissions are required at all.

I have no idea what is going on here. Any help would be gratefully received.


Kind wishes, Patrick

解决方案

This may sound like a stupid question, but did your code Close the file before it tried to open it again??

Sometimes "Access Denied" has nothing to do with security at all. The file can be locked by a process, be it your own or a different one, and you''ll get this message.


Try , setting Domain Account as ApplicationPoolIdentity.


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

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