Paul Mehner

blog

  Home  |   Contact  |   Syndication    |   Login
  37 Posts | 0 Stories | 20 Comments | 19 Trackbacks

News

Archives

Post Categories

Old Blog

It is very common for posters on newgroups to recommend that solution seekers run the “aspnet_regiis -i“ command to fix various problems and ASP.NET maladies. Unfortunately, the -i flag of the aspnet_regiis command does much more than is usually required to fix most problems. It is a sledge hammer when the pennyweight would be a much better choice.

The -i flag causes the aspnet_regiis command to perform its work on every website on the box, not just the one that needs it. As the .NET framework 2.0 begins to ship there will be more developers and production servers running both version of the framework. Running the aspnet_regiis command with the -i flag will associate all websites on the box with the framework from wence the command was run (there is one version of the aspnet_regiis command for every installed version of the .NET framework). It is also useful to note that the -i flag will reset auto-generated values with immediate impact on forms based logins and viewstate checksums. If you run the command with the -i flag on a live production server you may very well interupt the applications of logged in users of other applications on the same box. The “-i“ flavor of the command should never be run in a production environment unless there are no active users logged on, and all websites on the box happen to be on the same .NET framework version.

Running aspnet_regiis -? will show you the other options, which allow you to perform selected operations on individual websites instead of the entire box.


 

posted on Wednesday, August 03, 2005 3:05 AM

Feedback

# South Sound .NET User Group 8/11/2005 2:48 AM
South Sound .NET User Group

# re: Running "aspnet_regiis -i" Not Always The Best Choice 12/1/2006 8:26 PM Pharmann
Finally someone with a littlebit of brains. yet you get around the What then? question very quickly. Would have been nice if you had given us a way to do things instead of just reffering to the help you can get out of a dosprompt...

# re: Running "aspnet_regiis -i" Not Always The Best Choice 8/15/2007 11:56 PM Harish Ranganathan
http://msdn2.microsoft.com/en-us/library/k6h9cz8h(VS.71).aspx The above MSDN article lists all the available options and the specific command to update a single web application is Aspnet_regiis -s W3SVC/1/ROOT/SampleApp1

Hope this helps.

# re: Running "aspnet_regiis -i" Not Always The Best Choice 10/25/2007 9:27 PM kalaiarasu
Many times we come across incompatibility of ASP.NET application version and ASP.NET version installed by default on the production machine. I came across this issue twice today browsing the net. It can be either ASP.NET 1.1 application which is about to be installed on IIS with only ASP.NET 2.0 installed or 32 bit application which is about to be installed on 64 bit machine or whatever.



In the forums and all over the search engines the most common solution (for almost 5 years) is to use aspnet_regiis -i in order to re-register ASP.NET on the machine. aspnet_regiis -i is quoted many times in FAQ sections of technology forums.



However it will be bad practices to use "-i" switch since it installs the specific version of ASP.NET and registers script maps to the root of the default Web Site and recursively to all virtual directories below the root. This way it can break existing applications installed or others that will be installed in the future.



The right way to use aspnet_regiis in order to update script maps for the specific installed application will be like so:



aspnet_regiis -ir -enable - Installs ASP.NET version with root and enables it.
aspnet_regiis -s path - Registers script map for our Application.


This way our registration will not affect other applications on the machine.


# re: Running "aspnet_regiis -i" Not Always The Best Choice 3/16/2008 1:38 AM George
How do you run aspnet_regiis

I have tried running from the command promt but my system does not understand the command

...is not recognised as an internal or external command

Where on earth is it run from ????

# re: Running "aspnet_regiis -i" Not Always The Best Choice 3/16/2008 9:56 AM Paul Mehner
C:\Windows\Microsoft.NET\Framework\v2.0.50727 (change this path to match the version of the framework that you are using for the website). Use -? to get the options (don't assume -i).

# re: Running "aspnet_regiis -i" Not Always The Best Choice 4/23/2008 6:57 AM vin
Hi all,

I have a created a website using .net v1.1.4322 ,My web page has some validations which is not being processed and now i dnt have access to the server to change or regigister iis.Now if i can copy the folder aspnet_client folder and paste it in the source code path.Wil it work??

# re: Running "aspnet_regiis -i" Not Always The Best Choice 4/23/2008 7:54 AM Paul Mehner
Copying a 1.1 aspnet_client folder is not adequate to make your application execute under the corresponding version of the .net framework.

# re: Running "aspnet_regiis -i" Not Always The Best Choice 6/18/2008 2:38 AM nagesh
Really interesting solution finally from Nagesh Kulkarni

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 7 and 1 and type the answer here: