Mono 2.4、AutoHosting 和 MVC

发布于 2024-07-15 20:19:20 字数 171 浏览 3 评论 0原文

mod_mono 的 AutoHosting 可以修改为支持 ASP.NET 吗? ATM 它实际上不起作用:链接。 / 有效,但运行时完全忽略 Global.asax 并且不遵循路由约定。

Can mod_mono's AutoHosting be modified to support ASP.NET? ATM it doesn't really work: Link. / works, but the runtime ignores Global.asax altogether and doesn't follow the routing conventions.

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

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

发布评论

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

评论(1

踏月而来 2024-07-22 20:19:20

Mono 中 AutoHosting 的目的是通过减少配置服务器所需的工作量,使人们尽可能轻松地快速获得 Mono 上托管的 ASP.NET 站点; 但是,它是通过托管已配置为 ASP.NET 文件类型的文件类型来实现的。 您可以在 mod_mono.conf 文件中找到配置为托管的文件扩展名。

由于 MVC 路由避免使用文件扩展名,因此它可能不是 MVC 托管的良好解决方案。 也就是说,如果您绝对必须使用 AutoHosting,您可以将以下内容添加到 mod_mono.conf 文件中,以将服务器的所有内容设置为 x-asp-net 内容:
ForceType application/x-asp-net

这样做具有更广泛的影响,所以我不能说我会推荐它。

如果您能够更改 Apache 服务器的配置,那么仅为应用程序配置 mod_mono 可能会获得更好的结果。

The purpose of AutoHosting in Mono is to make it as easy as possible for someone to quickly get an ASP.NET site hosted on Mono by reducing the amount of effort needed to configure the server; however, it does so by hosting file types which have been configured as ASP.NET file types. You can find the file extensions it is configured to host in the mod_mono.conf file.

Since MVC Routing avoids using file extensions, it is probably just not a good solution for MVC hosting. That said, if you absolutely must use AutoHosting, you could add the following to your mod_mono.conf file to set all content for the server to be served as x-asp-net content:
ForceType application/x-asp-net

Doing so has broader implications, so I can't say I'd recommend it.

If you have the ability to change the configuration for the Apache server, you would probably get better results from just configuring mod_mono for your application.

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