12

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.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Wizard of Oz
  • 175
  • 1
  • 1
  • 9

3 Answers3

11

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.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
7

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).

chrish
  • 2,352
  • 1
  • 17
  • 32
1

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.

richb01
  • 1,097
  • 2
  • 13
  • 25