views:

3564

answers:

8

Hi,

  1. We are looking to use the MVC Framework in our SP Application.
  2. This is what we are trying to accomplish... A virtual directory within the SPSite which can host and run MVC. for e.g., /_layouts/MVC/

Any hints on the required configuration changes (if at all this is possible) will be very helpful.

Kind regards, Ashish Sharma

A: 

I would recommend running your virtual directory in it's own app pool. I'm leveraging MVC on some other Microsoft products and the app pool's Managed Pipeline Mode must = 'Integrated' for MVC.

SaaS Developer
+4  A: 

You're going to have a hoot of a time de-inheriting everything (modules, handlers, assemblies, namespaces) in the MVC app's web.config. I would recommend that instead of trying to get MVC working inside of the same IIS web site, why not just run your app outside of SharePoint? Joel Oleson just blogged about using "widgets" or "web parts" as a form of SharePoint integration:

Joel Oleson

Peter Seale
A: 

ScottGu has stated that the MS MVC is currently integrating with SharePoint - http://weblogs.asp.net/scottgu/archive/2008/02/12/asp-net-mvc-framework-road-map-update.aspx#5792984

Slace
This link states that ScottGu mentioned that it MIGHT be in a future release, but there is no integration with SharePoint at this point.
Mr. Kraus
Yes, and the question was could you do MS MVC in SP. The answer is no you can't. In the future you may be able to. You also may have a flying car, but it'd be wrong to say you will have them
Slace
+1  A: 

Hi,

We are using the same approach that you have suggested and it has worked for a POC project. We host a virtual directory within the _layouts directory. You don't even need to give it its own application pool.

Just make sure that you have the MVC web.config in the created virtual directory. Strip out the parts for User management, etc added by Visual Studio.

The nice thing is you can use the SPContext, etc and they work the same way as they would in a webform page.

Kind Regards, Ashish

SharePoint Newbie
A: 

Ashish,

I'd like to setup MVC inside a SharePoint _layouts folder as you have done.

I was wondering if you can use the SharePoint master page?

Regards Garth

+8  A: 

Ashish

This might be of interest to you http://www.codeplex.com/SharePointMVC

I published it about 5 minutes ago.

It is basically a library to help rendering ASP.MVC inside a SharePoint masterpage.

Still early days but u get the idea.

Regards

Simon

Simon
Does this work with the latest Sharepoint Foundation 2010 as well? Is this project still in progress or is it a thing of the past...
Robert Koritnik
RobertUnfortunatly I have not been working on any projects involving sharepoint 2010 and hence have not updated the code base. Fee free to submit a patch.
Simon
A: 

windbell write this:

http://simone.codeplex.com/wikipage?title=Host%20Aps.Net%20Mvc

A: 

I have heard from the MS MVC team that there is no plans for Sharepoint to use MVC. However MVC can be used with Sharepoint with a few tweaks

The following sharepoint site, www.themedicinecabinet.co.uk, was built using ASP.net MVC 2.

This article explains how this was done http://vspug.com/mbailey/files/2010/04/Using-ASP.NET-MVC-2-with-Sharepoint-Publishing.pdf

martin bailey