Mono 2.4、AutoHosting 和 MVC
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.