Zaki Mirza’s Blog

Icon

… About software and beyond!

ASP.Net Misconfiguration Solution


Many time when creating ASP.Net Application or ASP.Net  XML Web services people get into error reports e.g. Server Application Error, Authentication error in web.config file and more. I can’t really list all the errors that lie under this solution, but most problems are rooted from this very issue. (Im not really a professional solution provider or a troubleshooter, this post happens to come from my own experience. )

The issue is about multiple versions of ASP.Net installed on you machine. For example, you were working with Visual Studio 2003 and then switched to Visual studio 2005 or vice verse. You installed .Net platform 2.0 and even 3.0. Asp.net, usually, is left unconfigured during this configuration and if your very unfortunate, get misconfigured. One of the major root of this problem is, when people install IIS after they install the .Net Framework, or uninstall and reinstall it. If you are having problems with ASP.Net configurations, try the following method.

To solve this problem, following the following simple steps:

navigate to you Windows installation folder. Ill assume its C:\Windows\

navigate to Microsoft.Net\Framework\[version] (depending on which version of asp.net you want with IIS.)

You will see that there are many utilities in that folder. (in my case, it is C:\Windows\Microsoft.NET\Framework\v2.0.50727). The utility that we require is aspnet_iisreg.exe. (for a more technical introduction to this utility, click here). This utility reconfigures this version of asp.net for IIS. This utility requires command line arguments. Here’s what microsoft has to say about it:

When multiple versions of ASP.NET are installed on a computer, ASP.NET is said to be running side-by-side. In this setup, Internet Information Services (IIS) needs to know which version of the ASP.NET ISAPI (aspnet_isapi.dll) should process a page in an ASP.NET application. The ASP.NET ISAPI version that is associated with an ASP.NET application determines which version of the CLR is used for the application. An ASP.NET application is associated with an ASP.NET ISAPI version using a script map in IIS. To simplify the configuration process for an ASP.NET application, each version of ASP.NET comes with a linked version of Aspnet_regiis.exe.

Goto start menu and click Run and type “cmd”. A terminal window should open. Drag this aspnet_iisreg.exe file onto the terminal window. The terminal window will now be showing this file’s name and a prompt after it. type -i after it. Basically we need to run the command “aspnet_regiis.exe -i”. This will reinstall this version of asp.net for iis. It will take some time to configure IIS.

If the above solution does not provide the adequate result, or creates any problems feel free to ask.

A very good online magazine to read for IT professionals is the microsoft TechNet. For more information about configuring asp.net versions for IIS refer to this article on TechNet. For more information about .Net Framework tools check this out.

I hope this helps some poor souls out there who are too exhausted having to post on forums and searching on google.

Advertisements

Filed under: .net, Troubleshooter, , , , , , , ,

One Response

  1. Liz says:

    You are a total lifesaver – thank you so much!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

RSS Google Shared Items

  • An error has occurred; the feed is probably down. Try again later.

RSS Google Reader Starred Items

  • An error has occurred; the feed is probably down. Try again later.

Top Clicks

  • None
%d bloggers like this: