IHttpModule 未应用于虚拟目录

发布于 2024-08-30 02:16:26 字数 513 浏览 2 评论 0原文

我有一个网络文件夹作为虚拟目录映射到我的 iis 应用程序,并且我正在尝试使用 ihttpmodule 对位于该处的文件进行一些身份验证。我已经验证 ihttpmodule 对于我的应用程序中的其他任何内容都可以正确触发,而不仅仅是位于虚拟目录中的文件。我发现的大部分内容是该目录无法列为应用程序(事实并非如此),并且一切都应该正常工作。我发现的另一个解决方案是将模块标签添加到标签中,但这似乎也没有帮助。我发现的一切都在谈论阻止这种情况的发生。所以我的问题是可以设置什么导致它不起作用?是否需要设置一定的执行权限?还有其他iis设置可能导致这个问题吗?这是一个 mvc 应用程序,这就是我的目录结构的布局方式:

server/app <- 我的应用程序文件夹

server/app/content/downloads <- downloads 是虚拟目录

我是否必须直接添加虚拟目录在我的应用程序目录下?这是问题的一部分吗?我无法直接控制运行代码的服务器,因此测试有点痛苦……所以在开始向我的操作人员发送电子邮件之前,我一直在寻找更多的想法。谢谢!

I have a network folder that is mapped to my iis app as a virtual directory and I'm trying to do some authentication for files that are located there with an ihttpmodule. I've verified that the ihttpmodule is firing properly for anything else in my app, just not the files located in virtual directory. Most of what I've found is that the directory can't be listed as an application (which it isn't), and everything should work. The other solution that I found was to add the the module tag to the tag, but that didn't seem to help either. Everything that I've found talks about stopping this from happening. So my question is what could be set that is causing this to not work? Is there a certain execute permission that needs to be set? Any other iis settings that could cause this? It is an mvc app, and this is how my directory structure is laid out:

server/app <- my application folder

server/app/content/downloads <- downloads is the virtual directory

Do I have to add the virtual directory directly under my app directory? Is that part of the problem? I don't have direct control of the server my code is running on, so testing things out is a bit of a pain... so I was looking for some more thoughts before starting to send emails off to my operations people. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

╄→承喏 2024-09-06 02:16:26

好吧,我想我找到了问题所在......默认情况下,iis6 不会通过 .net 运行时传递可执行文件、zip 文件或任何此类性质的文件。它只对 .aspx 文件等执行此操作,因此它永远不会触发我的 ihttpmodule。看起来您可以通过为该扩展添加映射来强制执行此操作,但是是否有代码可以解决此问题?或者这是唯一的方法?

Well, I think I found what the issue is.... it looks like by default, iis6 does not pass executables, zip files, or anything of that nature through the .net runtime. It only does that with .aspx files and such, so it will never fire my ihttpmodule. It looks like you can force it to by adding a mapping for that extension, but is there a code work around for this? Or is that the only way?

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