在 IIS/ASP.NET 上的物理文件夹中创建虚拟应用程序/目录
我想要实现的目标很简单:
- 我有一个网站,说“我的网站” - http://localhost< /em>
- 在这个网站中,我有一个(物理)文件夹“foo” - http://localhost/foo
- 在“foo”文件夹内,我想要一个名为“upload”的虚拟目录(应用程序?),因此 URL 变为http://localhost/foo/upload
请注意,“my-site”是一个空网站,其中包含一堆文件夹,“foo”、“bar”、“因此
,当我右键单击“foo”并选择“新建>虚拟目录”并添加我在 VS.NET 中编写的应用程序时,然后尝试导航到 http://localhost/foo/upload 我收到此错误:
Parser Error Message: An error occurred loading a configuration file: Failed to
start monitoring changes to 'C:\InetPub\my-site\foo\web.config'
because access is denied.
问题是,没有 Web 配置。 在“foo”文件夹中,但它不应该,因为它只是站点中的普通文件夹。 如果我在顶层添加虚拟目录,例如 http://localhost/foo_upload,一切都会正常工作。 ..那么,我在这里做错了什么?
What I want to achieve is simple:
- I have a website, say "my-site" - http://localhost
- In this website I have a (physical) folder "foo" - http://localhost/foo
- Inside the "foo"-folder I want to have a virtual directory (application?) called "upload", so the URL becomes http://localhost/foo/upload
Notice that "my-site" is an empty website with a bunch of folders in it, "foo", "bar", "baz", etc.
So when I right click on "foo" and choose "New > virtual directory" and add my application I've written in VS.NET and then try to navigate to http://localhost/foo/upload I get this error:
Parser Error Message: An error occurred loading a configuration file: Failed to
start monitoring changes to 'C:\InetPub\my-site\foo\web.config'
because access is denied.
The thing is, there is no web config. in the "foo"-folder, and it shouldn't since it's only a normal folder in the site. If I add the virtual directory at the top level, at say http://localhost/foo_upload, everything works as it should... so, what am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这听起来像是您的系统存在权限问题 - 对于 .NET 帐户,运行 ASP.NET 的用户上下文需要访问您的站点。
在 Windows Server 2000 之前的系统上,此用户是一个简单称为 ASPNET 的本地帐户,之后更改为 NT_AUTHORITY 帐户之一 - 找到此用户的最简单方法是向 IIS WPG 组(本地组)提供访问权限帐户。
MS 在 http://support.microsoft.com/kb/316721/ 中提供了说明,请使用通过上述内容来确定您应该检查哪个用户帐户的访问权限。
It sounds like a permissions problem with your system - for a .NET account the user context ASP.NET runs in requires access to your site.
On systems up to Windows Server 2000 this user was a local account simply called ASPNET, after that is changed to one of the NT_AUTHORITY accounts - the easiest way to find this is to provide the IIS WPG group (a local group) with access to the account.
MS provides instructions at http://support.microsoft.com/kb/316721/, use the above to determine which user account you should check access for.
我只是为有同样问题并找到这个主题的人回答。
我向每个人添加了权限(在本例中,它将位于文件夹
C:\InetPub\my-site\foo\
中)。 然后我在页面上打印了哪些用户正在该文件夹中执行应用程序...类似:
然后我删除了每个人的权限并添加了我获得的用户。
I'm just answering for someone who has the same problem and found this topic.
I added a permission to Everyone (in this case, it would be in the folder
C:\InetPub\my-site\foo\
). Then I printed on the page what user is executing the app in this folder...Something like:
Then I removed the permission to everyone and added the user that I got.