Geeks With Blogs
Paul Mehner 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 3, 2005 3:05 AM | Back to top


Comments on this post: Running "aspnet_regiis -i" Not Always The Best Choice

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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...
Left by Pharmann on Dec 01, 2006 8:26 PM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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.
Left by Harish Ranganathan on Aug 15, 2007 11:56 PM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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.
Left by kalaiarasu on Oct 25, 2007 9:27 PM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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 ????
Left by George on Mar 16, 2008 1:38 AM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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).
Left by Paul Mehner on Mar 16, 2008 9:56 AM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
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??
Left by vin on Apr 23, 2008 6:57 AM

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

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
Really interesting solution finally from Nagesh Kulkarni
Left by nagesh on Jun 18, 2008 2:38 AM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...

Just a note..

When working with a x64 windows OS, the path to is :

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe

If you run the 32 bit version you will get an error...

The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible.
Left by Stephen Barclay on Feb 01, 2009 11:40 AM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
so what is the solution for 64 bit machine
Left by sathish kulal on Mar 05, 2009 7:02 AM

# re: Running "aspnet_regiis -i" Not Always The Best Choice
Requesting Gravatar...
It appears that if you want to run 32-apps on a 64-bit OS, you should first run this:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true

where adsutil is in %windir%\Inetpub\AdminScripts
Left by Mark on May 19, 2009 3:07 PM

Your comment:
 (will show your gravatar)


Copyright © Paul Mehner | Powered by: GeeksWithBlogs.net | Join free