1. Install the different dotnet framework versions on the server.
When installed you can check the c:\windows\microsoft.net\framework folder and each installed version contains an own folder named vx.x.xxxx. On my server, running
dir c:\WINDOWS\Microsoft.NET\Framework\v*gives the following output
2007-09-12 08:15 <dir> v1.1.43222. Make sure the needed framework is installed in the IIS
2007-09-12 08:44 <dir> v2.0.50727
Each framework version installs a tool named aspnet_regiis.exe. This tool is used to manipulate the IIS metabase for asp.net registrations and mappings. Depending on which version of the framework the tool is shipped with, there exists different switches that can be used. Run the exe in a command window to see which are supported for your version.
To see which frameworks is installed in the IIS metabase, run the tool with the -lv flags. (Example below)
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -lv
2.0.50727.0 Valid (Root) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
If your needed framework isn't listed, go to the version folder and run the aspnet_regiis.exe with the -ir flag. (the -i flag will also install the framework but will also update the scriptmaps, which we don't want to do (not yet anyway))C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -ir
Start installing ASP.NET (1.1.4322.0) without registering the scriptmap.
Finished installing ASP.NET (1.1.4322.0) without registering the scriptmap.
Running the -lv again we'll se that we now have two frameworks registered in the IIS metabase.C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -lv
1.1.4322.0 Valid C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
2.0.50727.0 Valid (Root) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
3. Install the scriptmaps on the web applicationIn addition to installing the framework in the IIS metabase we need to configure the web application to use the specific framework version.
To see which mappings that are in effect use the -lk flag
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -lk
W3SVC/ 2.0.50727.832
W3SVC/1/ROOT/ 2.0.50727.832
W3SVC/1/ROOT/Reports/ 2.0.50727.832
W3SVC/1/ROOT/ReportServer/ 2.0.50727.832
W3SVC/3/Root/ 2.0.50727.832
To set the scriptsmaps for a specific application use the -s flag. (here my application is running on the path W3SVC/258083574/root/MyApplication)C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -s W3SVC/258083574/root/MyApplication
Start registering ASP.NET scriptmap (1.1.4322.0) recursively at W3SVC/258083574/root/MyApplication.
Finished registering ASP.NET scriptmap (1.1.4322.0) recursively at W3SVC/258083574/root/MyApplication.
When installation is successful use the -lk to see the updated mappingC:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -lk
W3SVC/ 2.0.50727.832
W3SVC/1/ROOT/ 2.0.50727.832
W3SVC/1/ROOT/Reports/ 2.0.50727.832
W3SVC/1/ROOT/ReportServer/ 2.0.50727.832
W3SVC/258083574/root/MyApplication/ 1.1.4322.0
W3SVC/3/Root/ 2.0.50727.832
4. Make sure each version uses separate Application poolsA common mistake is to use the same application pool for multiple applications running different versions of the framework. This is not recommended and will most certainly break in time.
So... don't.
Changing application pool settings and creating new ones is done in the mmc tool (Internet Information Services). You don't have to configure the pools, just don't mix applications running on different framework versions.
5. Make sure that WebService extensions allows webpages of the specific version
If you now test your new application and tries to view an aspx page but the server only returns a 404 error, then you need to fix the WebService extension settings.
Locate the Web Service Extensions folder in the mmc tool and Allow the ASP.NET version to execute.
Good luck!
No comments:
Post a Comment