独立MVC3 Web应用程序? [英] Standalone MVC3 webapp?

查看:109
本文介绍了独立MVC3 Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而不是去下的Silverlight / WPF的路线,我想建立在HTML5我(单用户)应用程序MVC3作为后端。这可能吗?是否有可能或实际使用此为一个独立的桌面应用程序?

Rather than going down the Silverlight/WPF route, i'd like to build my (single-user) application in HTML5 with MVC3 as the backend. Is this possible? Is it possible or practical to use this for a standalone desktop application?

我可以将它设置在IIS和关闭我去了,但是这不是想法 - 它的不可移植,需要一个固定的目录,我不能就这么火了我的应用程序的任何地方我把它无需安装IIS

I could set it up in IIS and off I go, but that's not the idea - its not portable, requires a fixed directory, and I can't just fire up my application anywhere I take it without installing IIS!

推荐答案

我已经尝试用过程中的一个独立的基于.Net的Web服务器,具有承载MVC应用程序的能力 - 它当然是可能的,你可以使用这样的网络在独立的应用服务器或者与在Windows应用程序的Web浏览器控件结合使用,或只是用类似的方式正常的浏览器,帮助系统在Visual Studio 2010中的作品。

I have experimented with a standalone in-process .Net based web server that has the ability to host MVC apps - its certainly possible and you could use such a web server in a standalone application either in conjunction with a web browser control in a Windows application, or just with a normal browser similar to the way that the help system in Visual Studio 2010 works.

有几个方案可供选择:

  • Neokernel (不是免费的)
  • C#WebServer的(开源的)
  • 在IIS防爆preSS可能是一种选择,但据我了解的重点是提供一个Web服务器的开发等在momoment我不知道该再分发可用。
  • Neokernel (Not free)
  • C# WebServer (Open source)
  • IIS Express may be an option, but as far as I aware the emphasis is on providing a web server for development and so at the momoment I'm not sure that redistributables are available.

有一个<一个href="http://stackoverflow.com/questions/6910153/how-to-popup-a-webform-in-c-windows-application/6910216#6910216">answer在另一个问题覆盖使用IIS承载Web核心看起来很整齐,但是需要IIS 7的机器上安装。

There is an answer on another question that covers using the IIS hostable web core which looks very neat, however requires that IIS 7 be installed on the machine.

另外我有一个去写一个小的Web服务器自己,做只是这一点。这真的wan't难,但棘手的事情是让我的Web服务器的行为正是因为IIS做处理ASP.Net请求时。虽然它至少有一些MVC应用程序的工作,绝对不与所有 MVC应用程序和一定量的调整的,几乎肯定需要努力得到它依赖于一切工作在MVC应用程序的复杂性。

Alternatively I had a go at writing a small web server myself that did just this. It really wan't that hard, but the tricky thing was getting my web server to behave exactly as IIS does when handling ASP.Net requests. Although it does work with at least some MVC applications, it definitely doesn't work with all MVC applications and a certain amount of "tweaking" would almost certainly be required to get it everything to work depending on the complexity of the MVC app.

我写的一个是codePLEX 提供如果你想看看它是如何工程和尽量写自己的(或修改它自己的目的 - 如果你想它的非开源许可的版本,然后就问)

The one I wrote is available on CodePlex if you want to see how it works and try and write your own (or adapt it for your own purposes - if you want a non open-source licensed version of it then just ask)

如果你想有一个工作网络服务器虽然C#WebServer的是一个更好的选择(虽然我还没有真正使用它,所以不知道太多关于它的工作原理)。

If you want a working web server though C# WebServer is a better bet (although I've not really used it and so don't know that much about how it works).

(我可能会避开整理我的Web服务器这些天,但此刻我有太多的其他项目!)

(I might get around to finishing my web server one of these days, but at the moment I have too many other projects!)

这篇关于独立MVC3 Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆