Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Choosing the Right Version of ASP.NET


Choosing the Right Version of ASP.NET

The .NET Framework provides support for side-by-side execution, which allows multiple versions of an assembly to be installed on the same computer, at the same time. It’s up to individual applications to select which version they need to use. The choice of an application doesn’t affect other applications that require a different version. ASP.NET applications are no exception and can work side-by-side using different versions of the runtime. For example, you can have installed ASP.NET 1.0 and ASP.NET 1.1 (or even a beta of a newer version) and map each application to a particular build.

When you install a version of the .NET Framework (which includes ASP.NET), by default all existing ASP.NET applications are automatically reconfigured to use the version being installed. This happens if a few conditions are met. In particular, the version of the .NET Framework you are installing must be newer than the version that is currently mapped to each application. The installing .NET Framework version must also be compatible with the version already mapped to the application. Application compatibility is broken only if the major revision numbers do not match. As long as the new version differs from the current only for the revision and/or build number, the upgrade is automatic.

To prevent the automatic remapping of all existing applications to the installing version of the .NET Framework, you should use the /noaspupgrade command-line option with the dotnetfx.exe setup program, as shown below. (Notice that dotnetfx.exe is the name of any redistributable that installs any version of the .NET Framework.)

dotnetfx.exe /C:"install /noaspupgrade"

The /C switch overrides the internal command (i.e., install) in the way defined by the programmer. As a result, the above program installs a version of ASP.NET but doesn’t upgrade existing applications.

In many cases, though, you can’t just control the command-line of dotnetfx.exe because it runs packaged in an installer application. What happens, therefore, is that all of your applications are automatically upgraded to the installing version, which is not necessarily a good news. How can you remap an ASP.NET application to use a precise version of the .NET Framework? Remember the aspnet_regiis.exe tool that Microsoft shipped with ASP.NET 1.1? Well, that is the perfect tool for this kind of task.

Basically, to make sure that a given ASP.NET application uses the correct runtime files, you must guarantee that all the ASP.NET-related extensions are managed by the correct executable. For example, to make sure that the Foo web site is bound to ASP.NET 1.0 even once you have upgraded to ASP.NET 1.1, you run the following command-line program:

aspnet_regiis.exe -s W3SVC/1/ROOT/Foo 

Of course, you must pick up the copy of aspnet_regiis.exe to run from the install directory of the target version of ASP.NET. For example, to remap Foo to ASP.NET 1.0, run aspnet_regiis from the following folder:

C:\Windows\Microsoft.NET\Framework\v1.0.3705

A similar action should be taken also to uninstall a version of ASP.NET without uninstalling the associated .NET Framework. You use the aspnet_regiis.exe utility of the target version and run it with the –u option.


Dino Esposito is Wintellect's ADO.NET and XML expert, and a trainer and consultant based in Rome, Italy. Dino is a contributing editor to Windows Developer Network and MSDN Magazine, and the author of several books for Microsoft Press including Building Web Solutions with ASP.NET and ADO.NET and Applied XML Programming for .NET. Contact Dino at [email protected].


Windows Developer Network CD-ROM Version 6.0 on Sale Now for only $29.95!

Windows Developer Network's CD-ROM 6 gives you all editorial content and source code from December 1991 through December 2002 issues. For 11 years, Windows Developer has been the independent technical magazine for Windows programmers covering articles ranging from quick technical tips to ready to use solutions for complex programming problems. Turn to Windows Developer as a unique and trusted source of Windows to Web development solutions.

Click here to purchase Windows Developer CD-ROM. Special Sale Price $29.95. Discount Key Code: WDCDROM2.


The PDF edition of Windows Developer is now available online at http://www.windevnet.com/wdn/issues/.



Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.