1

I have a very large and complex web application running .NET 3.5, with some classic ASP pages and VBScript components thrown in for good measure. The site is running on IIS7, and is a root website.

Ideally, I'd like to have a sub-application beneath this website which runs .NET 4, to deploy new components. However, this is presenting me with difficulties and the following error is showing:

The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the element of the Web.config file.

Is this going to be possible at all, or should I give up and find another way?

3 Answers 3

4

It is possible.

You need of course to have both frameworks installed on the web server; then, you will need to configure the site's root to run using the 3.5 framework, and the folder (or virtual directory) where your sub-application resides to run using 4.0. You will need at least two appplication pools, one for 3.5 and the other for 4.0; you can use the default ones (they are created automatically when registering the frameworks with IIS) or create custom ones, it depends on the server's configuration.

If the sub-application is unrelated to your main site, this should be enough; if they need to "talk", things will get somewhat trickier, as the main site and the sub-application will actually run in two completely different runtime environment, even if they reside in the same web site structure.

4
  • +1 your answer is dumb thorough.
    – Ziplin
    May 12, 2011 at 17:14
  • @Ziplin: why do you think it's dumb?
    – Massimo
    May 12, 2011 at 18:22
  • 2
    I'm not entirely sure but I think that was a compliment, saying its so thorough dumb people can follow it... Strange turn of phrase though... Jun 13, 2013 at 21:03
  • @Massimo I would take that statement as Mark explained it as well. +1
    – Jacob
    Jun 13, 2013 at 22:40
1

Yes, you'll have to configure this sub-application to run with a different Application Pool. You can create another one to operate with .NET 4.

These articles should be helpful with specifics about how to do this:

You could (possibly should) also upgrade the entire site to .NET 4. Most everything should be backward compatible.

1

I got it working by removing [targetFramework="4.0"] from the [compilation] node.

VS 2010, MVC 4 -> .net 4.0, IIS 5.

Still have issues with routing but at least the default page works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .