Install ASP.NET 4.0 alongside ASP.NET 2.0 on IIS6 - asp.net

I've read where you create a new application pool, one for 2.0 sites and one for 4.0 sites. But there is no option I see when creating a pool to configure the framework.
My problem is I have several 2.0 sites running as the Default Web Site. I added a WCF 4.0 service under a new virtual directory and set the framework to 4.0. I also put it in a separate app pool.
Now, I can only get one working at a time. Either the 2.0 sites or the 4.0 site. I get:
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.
Is it possible to do this under IIS6 and Windows Server 2003?

To clarify: Each app pool binds to the .NET framework of the first web site that uses it, in order of application startup. That first site will run fine, but all other sites will be restricted to the same app pool. You need at least one app pool per framework version; and in my experience, the most robust setup is one app pool per application - this way, you can switch framework versions without worrying about other applications, and you can kill individual applications through task manager when the need arises.

The App Pools don't need configuring, just make sure the 2.0 sites are running as one, and the 4.0 site running as another.

Related

How to route request from one application pool to another in iis 6.0

I have got two web applications (separate virtual directories) residing in the DefaultAppPool on Windows Server 2003. My first application has got a link and when I click on it, the second application opens up.
Now I want to use different .Net framework for both web applications and for that in IIS 6.0, I will have to host them in separate app pools.
Now the question is - is it possible to host them in different app pools and keep the behavior intact so that if I click on the link in first web application, it can still open the second web application hosted in a different app pool?
Thanks in advance,
D
I think I've found the solution and it is simpler than what I actually thought.
Steps I took:
Create another app pool in IIS 6.0 on Windows Server 2003
Assign one of the web applications to this pool. So now I have two web applications in two different app pools. Currently both are having ASP.NET version as 2.0.50727
Change the ASP.NET version of one of the applications to 4.0.30319. So interesting fact to understand here is - in IIS 6, you can't set the .NET framework for an app pool. It actually assumes it from the first application in it and then applies it to all the web applications residing in this app pool
And it is done!!
It can be checked to list all the sites and which .NET versions they are configured to by using aspnet_iisreg -lk. Run this command from your .NET framework directory. For ex: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
Both the sites with different .NET framework will be listed
Hope this helps.

Two different version of .net on server

Is it possible to have two different versions of the .net framework on the web server then have one Virtual directory use the 2.0 version and another virtual directory use the 4.0 version in the ASP.Net tab in IIS?
A customer has all of it's ASP.Net apps compiled in the 2.0 frame work. But they want to install a newer ASP.Net app in a different virtual directory. And this new app was created in the 4.0 frame work.
How can they configure this on IIS?
Yes it is possible to have multiple versions of .NET installed on a web server.
You can run multiple applications in IIS on different frameworks.
However an application can only use ONE framework. As a virtual directory is part of the application it runs under the application's framework. E.g. Application (.NET 2.0), it's Virtual Directories are CHILDREN of it, so they are running under .NET 2.0.
Further details on IIS, Applications and Virtual Directories
The solution would be to run 2 applications, one for 2.0 and one for 4.0.
Luckily, in IIS, there is a method to convert a Virtual Directory into a Virtual Application, which gives you the opportunity to use a different Application Pool, and therefore different framework version.
I'm going to recommend you read this StackOverflow post, that is far more eloquent then mine.
StackOverFlow - difference between application and virtual directory

ASP.NET version for IIS virtual directory keeps resetting from version 2.0 to 1 when iis is restarted

I have an ASP.NET website that i want to deploy to IIS 6.0. When i set the sites ASP.NET version to 2.0, the setting reverts to 1.0 when IIS is restarted. There are two other ASP.NET sites on the same server whose version setting is being maintained across IIS restarts.
So this problem seem to be affecting only new sites being created. I'm just wondering if i need to re-register iis or what?
So, here's why: one of your apps runs .net 2.0, while another runs 1.0, and they are using the same application pool. App pools are designed to run only 1 .net version. Unfortunately, this restriction isn't validated during setup time, but errors happen on runtime.
So, check that. Create another app pool for one of the .net versions.

IIS6 | Application Pools | ASP.NET Framework

In IIS6 it's possible to have more than one ASP.NET application running in the same application pool. This is fine, except that there is nothing in IIS6 that prevents you from running multiple .NET versions in the same pool.
When you create application pools in IIS7 you must explicitly state was .NET version will be running in that pool. Running multiple .NET versions in IIS7, in the same application, is impossible.
How can I enforce such rules on my IIS6 server in order to prevent my deployment team from creating such problems?
What I do:
Step 1. Create the following application pools:
.NET 1.1 Apps
.NET 2.0 Apps
Step 2. Disable the "Default App Pool"
Now, any time a new application is configured in IIS, it will not work right away because the default app pool is disabled. This forces the person configuring the application to select an app pool that is appropriate for the .NET framework version of the app.
We tend to use one application pool per site, so that each application is isolated in its own process space. Application pool recycles will only affect a single application, and each worker process ends up with its own 4gb memory space. Badly programmed applications have no chance of affecting other applications, resulting in a highly isolated deployment model.
We've also standardized on x64 OS builds running 32bit application pools. While there is overhead using this technique since each application ppol contains a separate copy of the .Net framework, we feel that the added granularity of the application space adds stability to our deployments. You also get the ability to run each application as it's own domain identity, allowing for further memory space isolation and eliminating any need for identity impersonate in web configs.
With IIS 7, you have the ability to run each application pool as either 32 bit or 64 bit, so you can run large memory applications in 64 bit application pools. IIS 7 application pool security is also much more simplified.
I don't think you can. What I do is name my app pools in IIS 6 so that they show what .Net version they host. That way it's easy to pick the correct app pool when creating a new application.
If I remember correctly, you can also setup application pools in IIS6 (Windows 2003). Create one application pool per framework version in use.
I am not aware of any possibility to enforce the version of the .NET framework being used by an application. If you have setup an application pool to use .NET 1.1 and you have a .NET 2.0 application running in that application pool, you will get an exception in the application (yellow screen of death), since it will not find some referenced assemblies and classes.

Does asp.net setting affect classic asp (IIS 6 settings)

My company has some classic asp sites and developing new sites in asp.net, and everytime we create a new site in IIS 6 all the sites go down for a couple of seconds. So I'm thinking of changing the default value of the ASP.NET version to 2.x since that is what we're developing and I'm wondinger if these settings somehow affect the classic asp sites that are running on same IIS.
All of them are asp.net 1.1 versioned right now but we have to get around this all-sites-down everytime we add a new site to IIS.
Any warnings? Anything I need to know etc?
Thanks a bunch.
All sites reset when you change the version of a site. Therefore, it is a good idea to change the default to the one you add the most.
The default setting will not affect any existing sites, .net, classic or otherwise.
The only issues you may have is that you cannot run a 1.1 virtual app within a 2.0 site.
Also, you cannot run different versions in the same app pool. Therefore you should change the default app pool at the same as changing the default version.
As an aside, I have read of some command line options and other setting that mean you can change the version of a site without causing all of iis to reset. However, I have not managed to do this personally.
Running a classic site along site a .Net site in the same app pool should be fine and you shouldnt see any down time in the IIS when you upload a new version to the server.
You will find the server pause for a few seconds if you change the config of any app pool or if you change over the .Net version that is running in a site, all sites running in that app pool will be reset as the app pool resets.
My recomendation would be to create 2 App pools one for your new .Net 2.0 sites and one for the old classic sites, this will also help out if you are undergoing development as although unlikely it is possable to write code to complete crash the app pool.
The only thing to remembger is that each app pool as a small memory overhead about 3-5MB so if you nmake an app pool for each site and host a large number of site you can very quickly run out of RAM.

Resources