在 IIS/ASP.NET 上的物理文件夹中创建虚拟应用程序/目录

发布于 2024-07-13 18:36:07 字数 1034 浏览 6 评论 0原文

我想要实现的目标很简单:

请注意,“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:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌路终见情 2024-07-20 18:36:07

这听起来像是您的系统存在权限问题 - 对于 .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.

暮色兮凉城 2024-07-20 18:36:07

我只是为有同样问题并找到这个主题的人回答。

我向每个人添加了权限(在本例中,它将位于文件夹 C:\InetPub\my-site\foo\ 中)。 然后我在页面上打印了哪些用户正在该文件夹中执行应用程序...

类似:

labelCurrentUser.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

然后我删除了每个人的权限并添加了我获得的用户。

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:

labelCurrentUser.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

Then I removed the permission to everyone and added the user that I got.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文