ServiceStack with MVC vs ASP.NET web

346 views
Skip to first unread message

Ermias

unread,
Oct 26, 2012, 3:59:08 PM10/26/12
to servic...@googlegroups.com
I'm trying to decide whether I should use ServiceStack with MVC or ASP.NET web. I used MVC before and I liked it much better than the traditional ASP.NET web application. However, after seeing how great ServiceStack is I'm having a second thought about MVC. I would like to access the same service from a Razor View or from a mobile application. I know ServiceStack supports Razor from ASP.NET web or even from a console application.

So, my question is which approach do you recommend? ServiceStack with MVC or ASP.NET web?

Thanks,

Ermias.

Demis Bellot

unread,
Oct 26, 2012, 4:10:51 PM10/26/12
to servic...@googlegroups.com
If you want to make use of ServiceStack's Razor support you should use a basic/empty ASP.NET host.
If you want to use MVC in the same Website Host as well then you should start with an MVC Web Project and host on a custom route like /api

Basically I like to use vanilla ASP.NET since there's less dependencies / less things that can go wrong. MVC installs via a HttpModule and likes to hi-jack everyone elses ASP.NET IHttpHandler mapped http requests which is why you need to add 

routes.IgnoreRoute("api/{*pathInfo}");

In the MVC Global Routes Configuration and 

<add key="webPages:Enabled" value="false" />

In the Web.config to disable the conflicting functionality MVC hi-jacks by default.


Ermias

unread,
Oct 26, 2012, 4:18:36 PM10/26/12
to servic...@googlegroups.com
Thanks for the response.

One more question: I know the SocialBootStrapApi sample is done for MVC; but, can the same sample be used for authentication/authorization for plain ASP.NET web applications too?

Thanks,

Ermias.

Demis Bellot

unread,
Oct 26, 2012, 4:33:16 PM10/26/12
to servic...@googlegroups.com
Yeah sure, that reminds me I got to do an example using vanilla ASP.NET.

I've got another simple Demo that I did for MonkeySpace that uses SS Auth + ASP.NET here (but only Credentials + Twitter + Facebook auth enabled):

Tho I'll be sure to create a new SocialBootstrapApi example without the MVC in the near future.

Cheers,

Ermias

unread,
Oct 26, 2012, 4:43:58 PM10/26/12
to servic...@googlegroups.com
I checked your slides for the MonkeySpace presentation; do you know if a video is available?

Thanks,

Ermias.

Demis Bellot

unread,
Oct 26, 2012, 4:47:53 PM10/26/12
to servic...@googlegroups.com
Nope sorry no idea, I'm guessing they'll let me know when it's ready. 

I'll announce it on twitter or this group when I get it.

Ermias

unread,
Oct 26, 2012, 4:49:27 PM10/26/12
to servic...@googlegroups.com
Thanks for all the great work!

Ermias.
Reply all
Reply to author
Forward
0 new messages