asp.net 位置标记不起作用
我们有一个应用程序在机器级别使用 web.config 文件中的位置标记 - 含义类似于 C:\Windows\Microsoft.NET\Framework\v2.0...\CONFIG\web.config,一种适用于整个服务器的应用程序 - 该应用程序下有许多虚拟目录,每个虚拟目录都有一个
这似乎该应用程序工作正常。但是,我们在同一台服务器上有第二个应用程序,我想向该应用程序的 web.config 文件添加位置标签 - 意思是应用程序目录中的本地 web.config 文件 - 并让每个应用程序指定一个位置以类似的方式标记。
这可能吗?因为它似乎不起作用。我已经尝试过:
<location path="My IIS App Name\CustomerA"> ...
并且
<location path="CustomerA"> ...
似乎都不起作用。我只需要这个位置节点包含 1 个节点。 也许有一些
We have an application that is making use of the location tag in the web.config file at the machine level - meaning like C:\Windows\Microsoft.NET\Framework\v2.0...\CONFIG\web.config, the one that applies to the whole server - this application has lots of virtual directories under it and for each one there is a
<location path="IIS Web App Name\CustomerA">...
This seems to work ok for that app. But then we have a second app on the same server, and I'd like to add location tags to that app's web.config file - meaning the local web.config file in the app's directory - and have each one of them specify a location tag in a similar way.
Is this possible? Because it doesn't seem to work. I've tried:
<location path="My IIS App Name\CustomerA"> ...
and
<location path="CustomerA"> ...
and neither seem to work. I just need this location node to contain 1 node.
Is there maybe some
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它必须是该虚拟内的文件或文件夹。因此,我可以在与配置文件相同的根目录中为“default.aspx”设置规则,或者管理内容文件夹的“Content”等文件夹。我已经成功地做到了这一点。
或者,将另一个配置文件放入您要为其设置自定义规则的文件夹中,并在那里定义将覆盖主...
HTH 的规则。
It would have to be a file or folder within that virtual. So I could set rules for "default.aspx" in the same root as the config file, or manage a folder like "Content" for the Content folder. I've done this successfully.
Or, put another config file in the folder you want to set custom rules for, and define rules there that will override the main...
HTH.