在 ASP.NET 中,HTTP 模块可以作为非外部 dll 吗?

发布于 2024-09-28 10:24:46 字数 207 浏览 0 评论 0原文

问题:

通常,当您创建 HTTP 模块时,您将其创建为单独的 dll 项目并在 web.config 中注册该 dll。

现在,是否可以直接在 ASP.NET 项目中编写 HTTP 模块,这样我就不必创建单独的 dll 项目?

注意:不要说作为同一解决方案中的添加项目,我的意思是在同一项目中。

或者只添加对此 dll 的引用就足够了?

Question:

Normally, when you create a HTTP module, you create it as separate dll project and register that dll in the web.config.

Now, is it possible to write a HTTP module directly in an ASP.NET project, so I don't have to create a separate dll project?

Note: Don't say as an added project in the same solution, I mean in the same project.

Or would just adding a reference to this dll suffice ?

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

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

发布评论

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

评论(1

时光倒影 2024-10-05 10:24:46

我认为你可以,将你的代码/类放在 app_code 目录中,仅此而已。

然后你可以通过他的命名空间和 web.config 上的类名来注册它。

I think that you can, you place your code/class inside the app_code directory, and that's all.

You then register it by his namespace and the class name on the web.config.

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