Click here to Skip to main content
15,867,686 members
Articles / Web Development / ASP.NET
Article

Versions of the .NET Framework and the IIS6 Application Pools

Rate me:
Please Sign up or sign in to vote.
4.86/5 (14 votes)
31 Mar 20073 min read 115.1K   34   14
When you need to run a different version of the .NET Framework on different Virtual Directories

Introduction

When a new version of any technology appears, there are always new rules to be considered.

As part of my job as a Web Administrator, I used to test the new web technologies on Testing Environment before applying it on the real one. Microsoft has made the .NET Framework starting with Version 1.0 followed by v1.1 and now there are new releases v2.0 and v3.0. Microsoft gave them the ability to run together on the same server at the same time.

Concepts

The same site can only run under one version of the .NET Framework. But if we have more than one Virtual Directory on that site, we can choose for each one of them to run on a different version of the .NET Framework.

Image 1

IIS 6.0 uses the IIS 6.0 process model (w3wp.exe) and uses an isolation feature called application pooling. Application pooling enables applications to run together in one or more processes, as long as they share the same pool designation.

Applications that are assigned different application pools never run in the same process.

Image 2

The Web Administrator can put the site and it's Virtual Directories in the same Application Pool.

Image 3

He can also put each Virtual Directory in a different one.

Image 4

When there is more than one version of the .NET Framework run on your server, they cannot be together on the same process. Every application pool have its own worker possess or/Processes. So every .NET Framework version must run on a different Application Pool.

All of those concepts will lead to one rule:

The Rule

You cannot run more than one version of the framework in the same application pool.

If you try to do so you will see this error appears:

Server Application Unavailable.
The web application you are attempting to access on this web server is currently unavailable. 
Please hit the "Refresh" button in your web browser to retry your request.

Take a look at your event viewer and you will receive Event ID 1062 that says:

It is not possible to run two different versions of ASP.NET in the same IIS process. 
Please use the IIS Administration Tool to reconfigure your server to run the application in a 
separate process.

How to make your Application Available again

When you need to run a different version of the .NET Framework on a different Virtual Directories inside the site, you need to create a different Application Pool and assign for each Virtual Directory one of the Application Pools that you have created. Then you can make each one of this Virtual Directory run on a different version of the .NET Framework.

In this example we have one site with two Virtual Directories and we need to run each one of them on a different version of the .NET Framework and assign for each one a different application pool.

Create Two New Application Pools:

  • Start Internet Information Services (IIS) Manager.
  • Expand the Application Pools Node - Right-click the Node, - New > Application Pool.
  • In the Add New Application Pool dialog box, type "AppPoolName" in the Application Pool ID text box. Leave the Use default settings for new application pool option selected, and click OK. Your new "AppPoolName" will be created.

Application Pool 1:

Image 5

Application Pool 2:

Image 6

Assign for each Virtual Directory a different application pool.

Virtual Directory VD1:

  1. Right-click VD1 Virtual Directory > Properties
  2. On Directory Tab > Choose the VD1AppPool from the DropDownList in the Application Pool section.

Image 7

Do the same for the VD2 Virtual Directory.

Image 8

Choose for each Virtual Directory to run under different versions of the .NET Framework.

  1. Right-click VD1 Virtual Directory > Properties
  2. On ASP.NET Tab > Choose the .NET Framework 1.1 from the DropDownList in the ASP.NET Version section.

Image 9

Do the same for the VD2 Virtual Directory.

Image 10

Now your applications on each Virtual Directory will run successfully under different Versions of the .NET Framework.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior) ICSS
Qatar Qatar
Sharepoint, MCMS




Comments and Discussions

 
GeneralMy vote of 3 Pin
hemantwithu12-Aug-13 8:24
hemantwithu12-Aug-13 8:24 
Generaladd 3.5 framework to aspnet tab in iis6 Pin
ScottZu7-Dec-07 17:00
ScottZu7-Dec-07 17:00 
GeneralRe: add 3.5 framework to aspnet tab in iis6 Pin
DaveHoganIW18-Feb-08 23:55
DaveHoganIW18-Feb-08 23:55 
There is no difference in the CLR version between .NET Framework 2.0, 3.0, and 3.5.
So your .NET 3.5 app will need to be ran under .net 2.0 in IIS. Confusing eh!
Questionwhy need asp.net 1.1? Pin
wang_lihua19-Apr-07 3:38
wang_lihua19-Apr-07 3:38 
AnswerRe: why need asp.net 1.1? Pin
Ahmed Abd El Kader22-Apr-07 3:45
Ahmed Abd El Kader22-Apr-07 3:45 
GeneralRe: why need asp.net 1.1? Pin
wang_lihua22-Apr-07 4:48
wang_lihua22-Apr-07 4:48 
QuestionWhy separate pools per VD? Pin
Richard Schaefer4-Apr-07 2:30
Richard Schaefer4-Apr-07 2:30 
AnswerRe: Why separate pools per VD? Pin
Ahmed Abd El Kader4-Apr-07 7:54
Ahmed Abd El Kader4-Apr-07 7:54 
GeneralExcellent Tip Pin
Moustafa Arafa3-Apr-07 20:44
Moustafa Arafa3-Apr-07 20:44 
GeneralRe: Excellent Tip [modified] Pin
Ahmed Abd El Kader4-Apr-07 7:34
Ahmed Abd El Kader4-Apr-07 7:34 
GeneralRelated Tool Pin
Vasudevan Deepak Kumar31-Mar-07 4:53
Vasudevan Deepak Kumar31-Mar-07 4:53 
GeneralRe: Related Tool Pin
Ahmed Abd El Kader31-Mar-07 10:32
Ahmed Abd El Kader31-Mar-07 10:32 
GeneralGet my five! Pin
pcthelp31-Mar-07 2:53
pcthelp31-Mar-07 2:53 
GeneralRe: Get my five! Pin
Ahmed Abd El Kader31-Mar-07 10:38
Ahmed Abd El Kader31-Mar-07 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.