Welcome to MSDN Blogs Sign in | Join | Help

Rahul Soni's blog

Never assume the obvious is true!

News



  • These postings are provided "AS IS" with no warranties, and confers no rights.
Unable to connect to Visual Studio's Localhost Web Server

Screwing up an installation is so easy! I realized it when I was working on an issue today and had to uninstall the .NET Framework (that's different story ;o). I used my Control Panel and uninstalled it, but I was not done yet! I wanted to wipe out all traces of .NET 2.0 from my box and I deleted the C:\WINNT\Microsoft.NET\Framework\v2.0.50727 folder. Then I simply re-installed it and found that everything was working fine except the projects which were being accessed through FileSystem. I was not able to debug those projects at all... Even a CTRL+F5 wouldn't work!!

Here is the error message which I got...

---------------------------
Microsoft Visual Studio
---------------------------
Unable to connect to Visual Studio's Localhost Web Server
---------------------------
OK  
---------------------------

Very soon, I found that there is a file called WebDev.WebServer.exe which was located in C:\WINNT\Microsoft.NET\Framework\v2.0.50727 folder and it was gone since I deleted the folder itself! Aahh... too late... But I was really happy when I found that when I copied the file WebDev.WebServer.exe from one of my colleague's box, it worked absolutely fine :o) And that just saved me a lot of time!

I would have hated myself, if I had to re-install the VS 2005 just because of a simple mistake.

The point to be noted here are...
1) Don't use Shift+Del to delete important folders. It is better to rename it ;o) (as if you didn't know already!)
2) In case you do the same mistake as I did... find a person who has the file, and Copy + Paste!!
3) It seems like VS2005 installation puts the file (WebDev.WebServer.exe) in the Framework folder. Take good care of it :o)

Cheers,
Rahul

Posted: Tuesday, July 11, 2006 7:58 PM by rahulso

Comments

senthil said:

actually i have the same problem and that exe file also exists in that directory

give me a suggestions
# August 18, 2006 7:25 AM

rahulso said:

How did you get the problem?
Was it working earlier? Do you remember any change which was made in this box after it stopped working?

You may also try using Filemon to see if there is any Access Denied or some file being asked for and not present in the system. May be that will help.
# August 18, 2006 10:33 AM

Frank said:

Thanks for the tip.

I had the same problem yesterday. I was too fast deleting the v2.0.... folder. Now after i copied the webdev.webserver from my second machine all is working fine again.

Cheers, Frank.

# November 21, 2006 1:48 AM

Ken Mann said:

Thanks for the tip about the missing exe.  

# November 24, 2006 10:32 AM

prakash said:

Hi i am also facing same problem "Unable to connect to Visual Studio's Localhost Web Server", i have that "WebDev.WebServer.exe" file in my "C:\WINNT\Microsoft.NET\Framework\v2.0.50727" folder.

I am not able to detect exact cause to this problem.

I am not able to debug any web application.

Event Ctrl+F5 is also giving same error...

So, i get two error messages as below :

1. "Unable to find version of the runtime to run this application"

2. "Unable to connect to Visual Studio's Localhost Web Server"

Please help me out...

# January 2, 2007 12:10 PM

rahulso said:

Hi Prakash,

Check if you are able to create a new Project. Also, find out if creating a project with FileSystem works or not. If filesystem works, your debugger is fine. Then check out what version is listed under the ASP.NET tab in your IIS server.

Also, try using aspnet_regiis -ua followed with a aspnet_regiis -i and see if that helps.

If you still have problems... Let me know the following...

1. Does creating a new Project work?

2. What is the Operating System and VS you are working on?

3. When did this problem start?

4. Has it ever worked correctly on this box?

5. What happens when you try to debug against a File System project. Give me the exact error message which is thrown.

6. What version is set for the project in IIS under that ASP.NET tab?

Rahul

# January 3, 2007 3:15 AM

Bhupinder said:

WebDev.WebServer.exe already exist but i replaced it with the one working on other machine...................It worked!!!!!!

# January 12, 2007 6:02 AM

megha said:

I had a problem with .net 2005. When i install it and run it, it worked fine. I also restart my computer then also it was fine. But on another day when i come and run my project the same error comes. Then i again set up .net 2005. then it worked fine. But the same thing i have to do again and again setup of .net every day.

So suggest me the answer of my problem

# February 6, 2007 6:24 AM

megha said:

I had a problem with .net 2005. When i install it and run it, it worked fine. I also restart my computer then also it was fine. But on another day when i come and run my project the same error comes. Then i again set up .net 2005. then it worked fine. But the same thing i have to do again and again setup of .net every day.

So suggest me the answer of my problem

Megha

# February 6, 2007 6:25 AM

rahulso said:

Hi Megha,

It this happens daily, I have a feeling that there is something goofy going on from the Policy perspective.

Give me the exact error message which you are facing. If it is the same error message as this post, try removing your PC from the domain and re-install. Let it be out of domain and try to repro the issue and see if that happens again.

HTH,

Rahul

# February 6, 2007 9:43 AM

Raghu vamshi said:

hi

i have installed visual studios Express webdeveloper addition,for two  days it worked

well but for third day it showed error message

so can any one help me plse to solve the problem

# March 10, 2007 4:15 AM

Raghu vamshi said:

hi

i have installed visual studios Express webdeveloper addition,for two  days it worked

well but for third day it showed error message

so can any one help me plse to solve the problem

thank you

# March 10, 2007 4:18 AM

rahulso said:

Hi Raghu,

What is complete error message you are getting? Do you remember making any changes to your PC?

-Rahul

# March 10, 2007 11:49 PM

Raghu vamshi said:

hi rahulso

I did not make any changes to my PC

except i reinstalled the web developer again,

it worked nicely for some time but again same problem continued

The error message was unnable to connect to

Visual Studio's local host webserver

and also

cannot find version of runtime to run this application

i have replaced Webserver.EXE file from remote system and placed in my PC for some time it worked ,but again same problem occured

can u plse give a solution for this?

thannks

# March 12, 2007 1:33 AM

rahulso said:

Hi Raghu,

Can you give me the following information...

1. Your OS

2. Are you an Admin on your box?

3. Is this PC part of a Domain or WorkGroup?

4. Where are you located?

5. Do you have IIS installed on your box? If yes, did you try creating a new project on your http://localhost/AppName??

Regards,

Rahul

# March 12, 2007 12:35 PM

Raghu vamshi said:

Hi Rahul

My OS is Windows XP SP2

I am Admin on my box

My pc is part of Domain(Stand alone)

IIS is installed in my system.I have created a new project and began to run ,when trying execute from the internet explorer (http://localhost/....)    an error occured stating that it is wrong to use authinication mode  Windows in the web.config file

so what could be wrong i do not understand

# March 13, 2007 1:44 AM

rahulso said:

Hi Raghu,

It seems like you are not using Integrated Windows Authentication Mode in IIS.

Can you please try that and let me know?

Also, it would be really nice if you could give me the EXACT error message. Press CTRL + C on the message box which is thrown for the error and paste it.

Regards,

-Rahul

# March 14, 2007 12:54 PM

Nick said:

Thanks so much for posting this!

I deleted the .NET2.0 folder earlier today to test a setup program's installer of the .Net framework. And after it installed I couldn't build my websolution anymore. Turns out I deleted this file! Thanks for the solution!

# April 9, 2007 12:18 PM

Ed Winborne said:

I get the same error message when I try to use the website menu->ASP.NET Configuration in the Visual Web Developer 2005 express edition to load the Web Site Administration Tool. I also get this if I right click on the open window and click "View in Browser". In All instances I get a local host Icon on my task bar Labeled ASP.NET Development Server, and a path such as http://Localhost:1548/WebSite2, which is the path to my website created by Web developer. If you right click on the Icon you get a dialog box with the following options "Run in browser", "Stop", and "Show Details". If you Click option 1 or 3 you get the above Error message "Unable to connect to Visual Studio's Local Host web server" but for option 1 the Internet Browser loads with a list of the files in the project which you can run to see if they will run in the browser for debugging. Option 3 does esentially the same thing but gives details about the physical path, the virtual path, Port Number, and the root URL which is a link you click on to do the same as option 1. With all these options I get the same error message as above every time I click any of the above options. Also I can not get the Web Administration tool to load and run no matter what I do. I have checked and all of the files and directories mentioned above are present in the right folders. I Have IIS installed on my computer and have tried loading and running the web administration tool in Visual Web Developer with IIS enabled and disabled but it makes no differance. I can run and debug aspx files from my virtual IIS directory with out any problems. Can Any body tell me why I am getting this error message and how to get the Web administration tool to run?    

# June 9, 2007 4:04 PM

narayana said:

i work on file system not on iis ,it was working fine

suddenly it started throwing this alert message--"unable to connect to visualstudios's localhost web server"

# June 27, 2007 6:28 AM

Peter said:

Same thing here. Windows XP Pro SP2 / Administrator, standalone. I created a new website in VWD2005 Express Edition, localhost/appname. When I go to Website-ASP.NET configuration it starts the ASP.NET Development server and in a while it throws "unable to connect to visualstudios's localhost web server:. I reinstalled .NET 2.0 and VWD2005 EE and it seemed to work fine. After an hour or so, same problem! I also did the aspnet_regiis thing as mentioned above. Help....

# July 3, 2007 9:20 AM

Peter said:

Sometimes, not always(!), I can start Menu-Website-ASP.NET Configuration AFTER I did a Menu-Build-Rebuild Website. Other times it gives me the error "unable to connect......" It also seems to depend on the portnumber that the localhost web server is openening. Windows Firewall is off. Can I shut down this webserver and always use IIS instead?

# July 4, 2007 3:52 AM

Peter said:

It gets even stranger.... I had two instances of SQLEXPRESS on my machine and I disabled the second one (SQLEXPRESS with FULLTEXTSEARCH enabled). Now my VWD is working fine! I can acces the ASP.NET configuration and I can use Visual Studio's localhost web server. I let you know if there are more problems from now on.

# July 4, 2007 7:21 AM

Sandip said:

dude, i did something similar to what u did..i uninstalled VS2005 first without uninstalling the patch for WebApps.and then coz i cant uninstall the patch..i just tried to get stuff done by installing VS2005...ignoring the patch alltogether!one look at ur blog and i knew where i screwed up!!thanks a million dude!!

# July 17, 2007 1:06 AM

Ganga said:

hi,

i am getting two errors like-

1.ASP.Net development server failed to start listening on port 1290.only one usage of each socket address is normally permitted

2.unable to connect to visual studio's localhost web server

i have installed VS2005 and i was working comfortably fine with the application yeasterday but today its showing me the above errors.i have that "WebDev.WebServer.exe" file in my "C:\WINNT\Microsoft.NET\Framework\v2.0.50727" folder.

# July 25, 2007 8:02 AM

rahulso said:

Hi Ganga,

Honestly speaking, I haven't seen this error before. Can you kill all instances of your webdev.webserver.exe and try again?

Also, if that doesn't work, try reproducing the error and run netstat -ano from your command prompt. It will tell you the PID of the application who is using the port which is conflicting.

In my case, when I was browsing a file the URL looks like the following....

http://localhost:1042/myProject/Default.aspx

And when I do netstat -ano, I get something like the following...

 TCP    127.0.0.1:1042         0.0.0.0:0              LISTENING       2656

Here 1042, is the port number and 2656 is the PID of the process. You can have a look at this PID in Task Manager (View - Select Columns - PID) and figure out which app is causing the issue.

Hope that helps,

Rahul

# July 25, 2007 11:54 AM

Dabbler said:

I don't seem to have the WebDev.WebServer.exe in my C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder. I seem to remember reinstalling .NET framework a while ago, and just tried to use ASP.NET Configuration from the Website menu... am getting the same "Unable to connect to Visual Studio's Localhost Web Server" error. No sure what I need to install, uninstall. Is there some way I can extract this file without uninstalling and re-installing?

Thanks!

# July 31, 2007 2:18 PM

rahulso said:

Hi Dabbler,

Do you have any other box which has VS 2005 installed? If yes, you can probably get it from there and retry!

You may also try using the extract command... http://support.microsoft.com/kb/129605. I haven't tried it on VS installs, but I guess it should work.

I have an ISO file with me to install VS 2005. It helps me in doing such stuff.

Hope that helps,

Rahul

# July 31, 2007 3:02 PM

asif ghanchi said:

hi

i'm working on asp.net2005 and i install ajax on it,i've not install ajax tool kit yet,

and i try to run any project than i find a error

"unable to find a version of the runtime to run this apllication" and than it show me another error"unable to connect to visual studio localhost web server"

i also try to run the project which i made earlier. but same...

so can u help me plz

waiting for ur reply

Regards

Asif Ghanchi

email id:ghanchiasif@gmail.com

# August 4, 2007 3:52 AM

asif ghanchi said:

hi

i already try to find the webdev.webserver.exe and than i run it than it show me the same error. when i executing any project.

Regards

Asif Ghanchi

# August 4, 2007 4:54 AM

Sanjeev said:

i am already having webdev.webserver.exe and its size is 116 kb.

When i try to run it shows me the error that access a socket in way forbidden by its access permission.

and then Unable to connect to Visual Studio's Localhost Web Server.

plz help.

i am using network drive.

Regards

sanjeev

http://mindgrillq.blogspot.com

# January 14, 2008 1:05 AM

rahulso said:

Hi Sanjeev,

Did you check the firewall and the ports? Is it blocked?

Regards,

Rahul

# January 14, 2008 3:14 PM

Michael said:

Hi,

   I've got the message ("unable to connect...")trying to run website in file system.

   When I tried "aspregiis -i" it said that "setup has detected some errors".

   When I checked  the setup log file, I found 4 "failure" messages:

   - Failure Cleaning up registry: CleanupRegistry failed with HRESULT 80070002: 'The system cannot find the file specified.  '

   - Failure Waiting for service to start: WaitForServiceState failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion.  '

   - Failure Starting service: w3svc: StartServiceByName failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion.  '

   - Failure Restarting W3SVC: RestartW3svc failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion.  '

Please, help!

Michael

# January 15, 2008 12:54 AM

rahulso said:

Hi Michael,

Are you logged on as an Administrator? Do as follows...

1. Login as Admin

2. Create a very simple text file and call it test.aspx. Check if you are able to run that page on that IIS.

3. It seems like the IIS is not appearing healthy or it could be something related with permissions.

4. Also check if you are able to browse any htm or asp pages.

Rahul

# January 15, 2008 11:08 AM

nifigasebe said:

Hi, Rahul

When I open in VWD 2005 a localhost website ("http://localhost/mysite") and press F5, it runs good.

But when I open site in file system("C:/mysite) and press F5 or Ctrl/F5 it gives the message ("unable to connect...")

Michael

# January 15, 2008 7:00 PM

nifigasebe said:

when I create new site in LOCAL IIS mode it works fine. when I create even very simple page in file system (C:/WebSites/simple.htm) it is unable to connect ...

I reloaded VWD 2005 Express Edition, made sure WebDev.WebServer exist, but nothing changed. I guess my ASP.NET is not installed properly.

I tried to correct it but failed.

Michael

# January 16, 2008 8:02 AM

nifigasebe said:

Maybe I need to correct my .NET Framework, and then reinstall ASP.NET?

Michael

# January 16, 2008 8:05 AM

rahulso said:

Hi Mike,

Have you tried creating a new project in some other folder, like C:\TestFolder\TestWebSite? If not, please try that.

If you like you can install Process Monitor and check if you are seeing any access denied on the folder where you are creating the website.

Re-installing .NET Framework might help as well in your case.

Regards,

Rahul

# January 16, 2008 10:46 AM

horizon said:

Everything was working fine. Then, i made some changes in date to do some experiments. first i forwarded the date by few months. Then, put it back to current. In the meanwhile, it started giving these errors:

- asp.net development server failed to start listening on port 1038 an attempt was made to access a socket in a way forbidden by its access permissions

- unable to connect to visual studio localhost web server

I have verified the existence of file WebDev.WebServer.EXE at this path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

its there.

can anyone give me some idea?

# February 28, 2008 1:03 PM

rahulso said:

Hello Horizon,

Do you have any Antivirus/Firewall which is locking up the port?

By any chance, are you using source safe?

# February 28, 2008 1:16 PM

Alex said:

rahulso's brilliant suggestion of checking the pID in netstat and killing the process in the Task Manager solved my problem. It was a process called 'SR_Service.exe' which is to do with my VPN client.

Thanks Rahul :)

# March 9, 2008 10:26 AM

Sohail Anjum said:

Thanks

Its Great you solved my problem

# March 19, 2008 12:37 AM

sasi said:

i got the same problem , for a long time i cannt solve it ,could anyonehelp me , and even from the starting my iis is also not working , i have the follwing problem,

Asp.Net developement Server failed to start listening on port 1045. error message:

a socket operation encountered a dead network.

unable to connect to viual stuidos localhost webserver.

i have my windows xp, visual studio 2005

pls help me.

# April 9, 2008 3:44 AM

rahulso said:

Hi Sasi,

This error message typically means a serious failure of the network system (i.e. the protocol stack that the WinSock DLL runs over), the network interface, or the local network itself is broken.

2 things...

1. Do you get this error message with the same port number everytime?

2. Do you have any proxies and is ByPass Proxy server for local addresses checked in your IE??

# April 9, 2008 12:20 PM

sasi said:

i,

thanks for ur reply, actually i am doing at home computer caught this problem

is there any solution , i have to format the computer ,reinstall everything

# April 9, 2008 10:15 PM

Gourav said:

Do one thing go to tool menu.

open Internet option.

select connection tab then open lan setting.

There select bypass proxy server for local address.

i will work.

# April 25, 2008 12:35 AM
Anonymous comments are disabled
Page view tracker