mattias
mattias

Reputation: 890

Is it possible to make a self-hosted project of a ServiceStack+MVC3 like SocialBootstrapApi?

I am learning how ServiceStack works with the help of self-hosting projects. Self-hosting projects are much easier to debug and understand, since no magic happens inside IIS.

I followed these steps, read http://www.servicestack.net/mythz_blog/?p=785 and applied them backwards.

It worked fine for Docs, but not for the SocialBootstrapApi. The code in Application_Start() from Global.asax is the problem I think

Steps for ServiceStack Docs

For SocialBootstrapApi I did the same except/and

Upvotes: 3

Views: 843

Answers (1)

mythz
mythz

Reputation: 143379

ASP.NET MVC can't be hosted in a self-hosted HttpListener (since it's coupled to ASP.NET), but ServiceStack does support hosting it's Razor and Markdown view engines inside a self-hosted HttpListener app.

The Razor Rockstars website is a show case website of ServiceStack's Razor and Markdown view engine support. razor-console.servicestack.net is the same website hosted in a HttpListener self-host. The source code of RazorRockstars is on GitHub with the RazorRockstars.SelfHost example contains the source code for razor-console. The one thing you have to remember with self-hosted websites is that the Razor view pages Build Action in VS.NET needs to be set to Copy if Newer so the views are copied in the /bin directory so they can be found by ServiceStack at runtime.

Upvotes: 2

Related Questions