ASP.NET 中的文件夹访问错误
我正在开发一个由其他人创建的 asp.net 网站。 有些文件存在于根文件夹中,有些文件存在于一个子文件夹中。 我可以访问浏览器中根文件夹中的所有文件,但是当尝试访问子文件夹中的页面时,会显示以下错误“
访问被拒绝”。 描述:访问服务此请求所需的资源时发生错误。服务器可能未配置为访问所请求的 URL。
错误消息 401.2.:未经授权:由于服务器配置导致登录失败。根据您提供的凭据以及 Web 服务器上启用的身份验证方法,验证您是否有权查看此目录或页面。请联系 Web 服务器的管理员以获得更多帮助。
我无法指出这个问题。我检查了 web.config 文件,但没有得到与该文件夹相关的任何内容。我知道在我的案例中很难找到确切的问题,但如果有人能给我可能的原因或线索,以便我可以尝试,我将不胜感激。
提前致谢。
编辑 有一个子文件夹web.config,内容如下
但是,即使我使用“管理员”登录它也会失败。
我遇到了这个问题,实际上之前是我注释掉的表单身份验证。
I am working on a asp.net website which is created by someone else.
Some files are exist in root folder and some are exist in one sub folder.
I can access all files from root folder in the browser, however when try to access the pages from sub folder is shows following error
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
I unable to point out the issue. I checked the web.config file, but didnt get anything related to that folder. I know it is difficult to find the exact issue in my case, but I would appreciate if anyone can give me possible reasons or clues so that i can try.
Thanks in Advance.
EDIT
There is a sub folder web.config with the following content
However, even if I login with "administrator" it fails.
I got the issue, actually previously it was Forms authentication which I commented out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
子文件夹中有web.config文件吗?这些可能适用当地限制。
其他最好知道答案的问题:
您使用什么身份验证方案(表单、窗口等)?
您尝试访问什么类型的内容(静态内容或 aspx)
您使用的 IIS 版本是什么?
Is there a web.config file in the sub-folder? These can apply local restrictions.
Other questions that it would be good to know the answer to:
What authentication scheme (forms, windows etc) are you using?
What sort of content are you trying to access (static content or aspx)
what version of IIS are you using?
对我来说这听起来像是 ACL 问题。正如 Xhalent 所要求的,更多信息会很有用。 IIS 正在使用的用户是否有权访问文件系统上的所有文件?
This sounds like an ACL problem to me. More information, as Xhalent asks, would be useful. Does the user that IIS is using have access to all of the files on the file system?