Determine Which version of .NET Framework Is Being Used

  • Thread starter Thread starter Cramer
  • Start date Start date
C

Cramer

I have been maintaining an ASP.NET 1.1 application for several years. It has
a lot going on (i.e., isn't a trivial system). Anyway, we just moved it to a
new server for which I requested the Framework 1.1 (with the 1.1 SP1) be
installed. Some bonehead in the server group went and installed both the 1.1
and the 2.0 versions of the Framework instead of just the 1.1. Framework
with the the 1.1 service pack 1. My understanding is that the server now has
two side-by-side copies of the .NET Framework running - the 1.1 and the 2.0
versions.

Questions:
1. How can I determine if my app is running against 1.1 (or force it to do
so)? I know that 2.0 should be able to run 1.1 apps, but I haven't tested
the app with 2.0.

2. What about the 1.1 service pack 1. Am I correct in thinking that
installing the 2.0 Framework does NOT patch the 1.1 installation, and we
still need to install the 1.1 service pack 1 in order to patch the 1.1
installation?

3. To be "safe", should we uninstall the 2.0 version of the Framework, being
that this non trivial 1.1 app has never been tested against the 2.0
Framework?

Thanks.
 
Cramer said:
I have been maintaining an ASP.NET 1.1 application for several years. It has
a lot going on (i.e., isn't a trivial system). Anyway, we just moved it to a
new server for which I requested the Framework 1.1 (with the 1.1 SP1) be
installed. Some bonehead in the server group went and installed both the 1.1
and the 2.0 versions of the Framework instead of just the 1.1. Framework
with the the 1.1 service pack 1. My understanding is that the server now has
two side-by-side copies of the .NET Framework running - the 1.1 and the 2.0
versions.

Questions:
1. How can I determine if my app is running against 1.1 (or force it to do
so)? I know that 2.0 should be able to run 1.1 apps, but I haven't tested
the app with 2.0.

2. What about the 1.1 service pack 1. Am I correct in thinking that
installing the 2.0 Framework does NOT patch the 1.1 installation, and we
still need to install the 1.1 service pack 1 in order to patch the 1.1
installation?

3. To be "safe", should we uninstall the 2.0 version of the Framework, being
that this non trivial 1.1 app has never been tested against the 2.0
Framework?


Environment.Version returns the version of the CLR in use.
 
re:
!> 1. How can I determine if my app is running against 1.1

<%
Response.Write("ASP.NET System Environment Version = " & System.Environment.Version.ToString())
%>

re:
!> (or force it to do so)?

You can use the IIS Manager to change the ASP.NET version
for any application ( in the ASP.NET tab for the application ).

Manually, you can do it the following way :

Open a command window to the 1.1 directory...
( Drive:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 )

....and run this command :

aspnet_regiis -s <path>

i.e. : aspnet_regiis.exe -s W3SVC/1/ROOT/AppVirtualName

You may have a different ID if you're running more than one website on the server.
To determine the root path, run this command first :

aspnet_regiis -lk

That command will list the path of all IIS metabase keys
where ASP.NET is scriptmapped, together with the version.

That will return a list like :
W3SVC/ 1.1.4322.0
W3SVC/1/ROOT/ 2.0.50727.3031
W3SVC/1/ROOT/anApp/ 1.1.4322.0
W3SVC/1/ROOT/anotherApp/ 2.0.50727.3031
W3SVC/1/ROOT/yetAnotherApp/ 1.1.4322.0

Then, you can run the aspnet_regiis -s command, with the correct path,
if you want to change the script mapping for any app.

Note : if the server is Windows 2003 or 2008, you need to *enable* ASP.NET 1.1 and/or 2.0
That works for both IIS 6 and IIS 7.

Also, since both the 1.1 and the 2.0 Frameworks are installed, make sure that your
1.1 applications are assigned to a different Application pool than any 2.0 application.

Not doing so will generate an application error.

re:
!> 2. What about the 1.1 service pack 1. Am I correct in thinking that
!> installing the 2.0 Framework does NOT patch the 1.1 installation, and we
!> still need to install the 1.1 service pack 1 in order to patch the 1.1 installation?

Correct on both counts.

re:
!> 3. To be "safe", should we uninstall the 2.0 version of the Framework, being
!> that this non trivial 1.1 app has never been tested against the 2.0 Framework?

1.1 apps and 2.0 apps can run concurrently on any server.
Just make sure you take the precautions outlined above.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top