Tuesday, January 22, 2008

When opening a project in VS2008, a dialog appears with asking to manually set up ASP.NET 2.0

the message dialog says:
"ASP.NET 2.0 has not been registered on the Web Server. You need to manually configure you Web server for ASP.NET 2.0 in order for your site to run correctly, Press F1 for more details"

I remembered there was an easy way to install ASP.NET 2.0 using a tool found in %WINDIR%\Microsoft.NET\Framework\v2.0.50727 called aspnet_regiis.

I opened a command line, I navigated to the above path and typed in
aspnet_regiis -ir

Note: I chose to use the -ir parameter to simply install ASP.NET, but not have it update the application pools. I have read that using the -i parameter can be dangerous, read the following link to get more detail:
http://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx

Below is the dialog from the command line window:
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -ir
Start installing ASP.NET (2.0.50727).
................................................................................
................................................................................
.......................................
An error has occurred: 0x80004005 Unspecified error



After hunting around the net, I happened upon this website that provided the answer:
http://weblogs.asp.net/scottgu/archive/2006/09/19/Tip_2F00_Trick_3A00_-Using-IIS7-on-Vista-with-VS-2005.aspx
Written by http://www.wyattpreul.com/

Solution to "An error occurred..."

1. Open C:\Windows\System32\inetsrv\config\applicationhost.config

2. Remove ISAPI filter entries inside the sections.

3. Stop the w3svc with "net stop w3svc"

4. run "aspnet_regiis -i"

5. Start the w3svc with "net start w3svc"


Using windows explorer, I went to the .config file referenced above and found:

«isapiFilters»
«filter name="ASP.NET_2.0.50727.210" path="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="" /»
«filter name="ASP.NET_2.0.50727.0" path="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" /»
«/isapiFilters»


I altered the file by removing the child nodes under isapiFilters.
The setting now looks like this

«isapiFilters»
«/isapiFilters»

I ran the application again:
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -ir
Start installing ASP.NET (2.0.50727).
................................................................................
...............................................................
Finished installing ASP.NET (2.0.50727).

C:\Windows\Microsoft.NET\Framework\v2.0.50727>


Success! thank you internet!

1 comment:

sai said...

how to stop w3svc