Can ASP.NET MVC 3 run inside a ASP.NET 3.5 web site?

11.4k Views Asked by At

I would like to know if it is at all possible to get an MVC3 solution wrapped in a CWAB (Composite Web Application Block) solution built in 3.5?

I'm aware that in IIS, 2.0/3.5 and 4.0 sites can run next to each other (but in different application pools) but because of the CWAB layer I do not have this luxury. I got MVC2 running successfully before but MVC2 is on the 2.0 runtime if what I've read is true.

I would really like to use Razor as well so going back to MVC2 in this scenario is not really an option.

3

There are 3 best solutions below

1
On BEST ANSWER

It should be possible. Just set your application pool runtime to 4.0 instead of 2.0.

.NET 4.0 runtime will be able to handle .NET 3.5 assemblies.

0
On

Razor requires features in .NET 4.0. However Tom Clarkson has a post called ASP.NET MVC 3 Razor View in SharePoint that talks about a (not-so-pretty) work-around. Basically, generate the view code from the cshtml files in .NET 4 and you can use them in .NET 3.5 (with a modified RazorEngine).

0
On

I'm encountering the same issue. The way I'm going to handle it is to write a WCF "front end" to SharePoint (.Net 3.5) and this will allow me to write the MVC app using MVC 3.