Is your IIS not recognizing aspx files or asp.net builds inspite of having .Net framework or Microsoft Visual Studio installed in your system? Is internet explorer browser prompting you to download an aspx file when you try to access it?
One possible reason most of the times would be that you installed the IIS server in your system after installing the Microsoft.Net framework Or Visual Studio. In other words .Net framework was installed first and IIS was installed later.
So what?
Well, if that is the case then it means that the IIS was not present when the framework was being installed and this prevented the dotnet framework installation process from registering itself with the IIS.
What is the solution now? Reinstall the framework?
Thankfully NO.
The steps to register ASP.Net with IIS is as follows:
If only Microsoft.Net framework is installed
If you dont have the visual studio installed, but only the framework installed then just open the command prompt and go to the following folder in your system:
%Windir%\Microsoft.Net\Framework\version
Change the above path appropriately as required. For instance if your windows root folder is C:\WINNT and the .Net framework version is 2.0.50727 then your folder path should be changed in the command prompt to
cd C:\WINNT\Microsoft.NET\Framework\v2.0.50727
If Microsoft Visual Studio is installed
If you have Visual Studio installed, then it has its own command prompt which defaults to the framework folder. So you are saved from all the typing you do in option1 mentioned above. Instead simply go to your visual studio menu item in your windows start menu and select the visual studio command prompt as follows
Start->Microsoft Visual Studio->Visual Studio Tools->Visual Studio Command Prompt
What Next?
Now there is a utility called aspnet_regiis which will register or unregister (and do much more) when executed.
Now since we need to register asp.net with IIS, all we need to do is run this utility with the -i switch. Hence just type the following command in the command prompt you have opened and press ENTER.
aspnet_regiis -i
The -i switch tells the utility to install(register) asp.net with the local IIS. The utility will initially show the following message
Start installing ASP.NET (version number)
…………….
And will proceed with the registration process and when completed will display the message Finished installing ASP.NET (version number)
And that should ensure that your IIS starts recognizing aspx files now.






This did not work for me. Do I need to restart the server in order for the changes to apply?