pastacool pastacool - 1 year ago 123
C# Question

Is it possible to self-host a MVC 4 Application without IIS (not Web API)?

So, anybody else has and idea how to go about this?

The reason for all those limitations are that it's not going to be a multi-user Web app but just a closed group of people will be accessing it and only on an Intranet so we were looking for a simple solution where we don't have to use any software setup outside our own (which has already update capabilities and handles up-/downgrades) and have full support/access to our already existing internal framework.

Answer Source

after some "creative" googleing (we got inspired by IronScheme - have a look at IronScheme.WebServer and IronScheme.Web.Runtime -> Web/Hosting) and reverse engineering a sample MVC App (just look at the call stack and dig thrugh MSDN) we've found a possible solution.

we're going to utilize System.Web.Hosting.ApplicationHost.CreateApplicationHost for accessing our MVC app and HttpListeneras our own lightweight only-for-our-purpose "webserver".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download