views:

27

answers:

2

Is it possible to host an ASP.net (MVC in particular, but I'm not sure if that's important) application from a self-hosted WCF service? I don't want to get into IIS, and I'd like to avoid something like Cassini if possible.

Sorry if this is a duplicate, it's really hard to find questions on this (everything is WCF on ASP, not the other way around.)

A: 

Technically yes I would have guessed. I've not done it but I would have thought that it's not particulary hard (maybe lots of boilercode though). I suspect that you would have to intercept the HHTP request and then create the ASP.NET pipeline. Is the source for cassini available to look at?

Preet Sangha
A: 

With a custom binding, I'd say it's possible, but would take quite a lot of work building that custom binding.

I would recommend you use IIS. Self hosted WCF services are not as scalable as IIS, and with IIS 7's support for binary protocols are almost entirely unnecessary.

Randolpho
This is meant to be lightweight and standalone, and does not need to scale, so IIS is pretty much out of the question. But if it requires a lot of work to use WCF I can look for another solution.
Andrew Koester
@Andrew Koester: Does it absolutely have to be *all* of ASP.NET? If you just need HTML rendering and not a lot of the event model stack working, I think you might get away with a RESTful WCF service (webHttpBinding) and some minor glue code on the service to handle rendering.
Randolpho
@Randolpho Like I said, I was interested in running MVC on it, so whatever that entails. I don't know how that differs from say, webforms, when it comes to rendering.
Andrew Koester