unable to connect to visual studio's localhost web server

Hi,

Getting the error above when trying to debug. Have been trying to fix. Reinstalled Visual Studio 2005 and problem remains... so i don't think it is with Visual Studio settings?

Running on windows server 2000. Installed a couple weeks ago and was running fine but just had a few problems with server in last couple days, like connecting to the lan and some strange things with Visual Studio then. Can anyone help on this?

Thanks, Aiden
AidenAAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
Any specific error messages?

Did you install latest service packs for VS after re-installing?

-->but just had a few problems with server in last couple days
May be some windows security updates or something on your server could have caused this...not sure.
0
AidenAAuthor Commented:
Hi, the error message is the one i specified in the name of this post.

Was trying to install windows server service pack 4 just to see if that helped also, and had to shut down the server... but now i can't get to it today again and am away until tues so can't do anything until then unfortunately.

But anyway, it worked before so i don't think it should have anything to do with needing to install service packs. Something must have changed somewhere... you have no idea what could have caused this?

thanks
0
guru_samiCommented:
-->you have no idea what could have caused this?
Not really....

Just wondering if something caused deletion of your WebDev.WebServer.exe
Check if you have that file under C:\WINNT\Microsoft.NET\Framework\v2.0.50727

Or may be some new updates of antivirus or settings change is blocking execution.
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

AidenAAuthor Commented:
Hey can't look right now as can't get to server. But checked that before and the webserver.exe file was indeed present. I'll check again but it should be there as i reinstalled everything.

As for updates... i'd doubt it since i can run visual studio on my pc which i presume should have the same updates...

So, in the projects property page start options... i have default websever selected. But how is all that configured. I guess it is somehow not seeing the file? some path has been altered maybe?
0
Vadim RappCommented:
idea #1: run aspnet_regiis –i  and  iisreset

idea #2: check if the server is actually working. For that, run something like netstat -a -b | find "LISTEN" > result.txt and see if it's listening. Or you can simply telnet to localhost <port>

idea #3: create the project on the machine's IIS to begin with, rather than in file system.
0
AidenAAuthor Commented:
Hi,

Just thinking about that... not sure what you're trying to do there. IIS is working fine... in fact, I am running the website off the server without any problem.

The problem mentioned above 'unable to connect to visual studio's localhost web server' relates to trying to debug in Visual Studio to try and understand some error on the site running off server which i am not getting on my local pc when i debug. Problem is, for some strange reason, visual studio doesn't seem to be able to bring up the local host web server. So, even if i try to go on a particular page and use 'browse with' i still get this error.

So, it seems to be like some kind of internal visual studio problem where the link to the local host webserver is corrupted... or I have no idea really.

But i can't see how you're solutions above would fix it since i don't think it is a .NET framework problem or an IIS problem? It was working fine last week, and then at some stage just stated not working?

thanks
0
Vadim RappCommented:
#2 and #3 apply to that local server, not to your IIS.

Also, reboot the machine.

Also, try the solutions offered in http://forums.asp.net/t/905409.aspx by cybernaresh and by kim steffensen

If #2 shows that the server is working, try connecting to 127.0.0.1:port .
0
AidenAAuthor Commented:
Hi, ok i'm not sure you might have to walk me through that...

I typed 'netstat -a -b | find "LISTEN" > result.txt' into the run box and nothing seemed to happen. Should I be typing in all of that exactly like that?

As for creating the project on the machines IIS, not sure what you mean there either? The project is already running fine in a virtual directory. Other then that, not sure what you want me to do?

will look at the solutions in the link you provided, but on first inspection, i think i already saw that page and it didn't help. i will check again

0
Vadim RappCommented:
1. 'netstat -a -b | find "LISTEN" > result.txt'
(which you run after having started your v.s. project for debugging) will write the result into the file result.txt in the current directory. After it finishes, type result.txt, hit enter, and review the contents.
The purpose at this point is to find out which of the two problems it is: (1) the project can't create virtual webserver, or (2) it creates it, but you can't connect to it.

2. Let's clarify where the problem is. When you create website project in visual studio, you can create it (1) in file system, and (2) directly on your local IIS. If it's created in file system, and then you want to debug or to run it, then you'd have to create virtual directory on IIS, mapped to the directory in the file system with the project. Visual Studio does it for you by launching its own webserver, independent from your local machine's IIS and running on some unoccupied port, and then v.s. launches web browser and tells it to navigate to the just-created website. The error message in the title of your question is exactly for this scenario, and says that your browser can't connect to that webserver. The comment from cybernaresh on the page I quoted suggests to try to run visual studio's webserver directly from the command line.

If you instead have created your web application directly on IIS, then there's no need in Visual Studio's webserver; in this case, Visual Studio creates virtual directory on your regular IIS, and your browser connects there when you run the project. If this is the scenario you have, then the error message "visual studio's localhost web server" does not apply at all.

So, which is this?
0
AidenAAuthor Commented:
ok i did a couple of things

(1) found host file under C:\WINNT\System 32\drivers\etc according to one of the problems listed in the link. it said 127.0.0.1 Localhost So that seems ok.

(2) I tried to open the webdev.webserver.exe file and got a new error: "Unable to find a version of the runtime to run this application". So, i figured i would try and re-install the .NET runtime. That turned out to be a big mistake as there was an error trying to reinstall which brought down the whole server. So, i had to reinstall visual studio from scratch. Anyway... error remains, and i haven't been able to find anything helpful about it. This is the only post i can see really http://forums.asp.net/p/1348698/2748320.aspx#2748320 which i don't think is going to solve the problem.

Trying also to copy in the webdev.webserver.exe file from a working pc (although i'm sure that won't make a difference) since that is mentioned in a few posts. But i can't imagine that will help.

Ok so, I was trying the first thing you mentioned and put in:
netstat -a -b | find "LISTEN" > result.txt                       and nothing happened. I do not see the output file.
netstat -a -b | find "LISTEN" > C:\result.txt                   also tried that, and no output file on C either

the only thing that worked was when i opened the command prompt and typed
netstat -a > C:\result.txt
0
AidenAAuthor Commented:
sorry somehow that got sent before i was finished.

So, that gives me a list of all ports and they all say LISTENING, except at the end, but i don't know what i'm looking at, or looking for.

Relating to your question 2, I am creating this project on my local PC and I can debug, run and publish the site. No problem there. I can move the published site to the server and it runs fine there also. However, the problem occurs when i try to debug the website from the server using a local copy of visual studio installed there. I'm confused where IIS comes into this? This is running in VS and I was to use the local host webdev webserver which seemed to work fine before. So, the application is not created directly on IIS (also i am running it on the server in IIS independently, just as a published site).

regarding the link you posted. I had seen that before, but i wasn't able to get things working anyway. I tried to "run visual studio's webserver directly from the command line" and it ran ok. Although now, it doesn't as mentioned above. But i didn't understand how to get it running on my particular project... the paths etc are confusing... maybe i will try again
0
Vadim RappCommented:
netstat is the command that shows all opened ports in the system, so the idea was to find out if visual studio's webserver is listening; but at this point we probably can assume that it's a given that it's not working, for whatever reason. Since you already tried to reinstall visual studio, the only text steps would be things like completely wiping out everything related to visual studio in registry in in file system, then reinstalling it "clean", and if that does not help, then reinstalling whole windows. It's up to you to decide if you want to go this route. Also I would try to monitor things by regmon and filemon, but not much hope that it would something so obvious.

The alternative: since your IIS is working (_if_ it's still working), create your web application in visual studio directly on the webserver, rather than in the file system. You can create new empty application on it, then import existing objects from the project in filesystem.

0
Vadim RappCommented:
> the problem occurs when i try to debug the website from the server using a local copy of visual studio installed there

This probably explains it. See the explanation of how it all works in http:#ID:29089181

When you have deployed it onto the iis on the server, then that's where you have to debug it. You have to connect to that IIS server because that's where it's hosted.
0
Vadim RappCommented:
Usually you debug on your own workstation, and when it's perfect, that's when you deploy to the production server.
0
Vadim RappCommented:
corrected link: http:#29089181
0
AidenAAuthor Commented:
Hi yeah, but i debugged on my own workstation and it was perfect, but then deployed to the production server and there was a problem. Since it was just easier to find out why it is not working by running a local copy on the server (since the environment there is different to the workstation and there may be something different occurring on it), i wanted then to just try and debug on the server to quickly find the issue. That worked fine for a while until for some reason the above problem started to occur.

But, there are some other random problems happening on the server, like, it is losing connection to the LAN and the internet for no obvious reason.

So, my thought at the moment is to change the operating system which is currently windows 2000 server, to windows 2003 server. I guess you probably agree this is the best solution at this point?
0
Vadim RappCommented:
Yes, indeed the problems usually come in packs.

Still, speaking of the debugging, if you wanted to debug in the environment as close as possible to the production, then you should be debugging it on the IIS on the server, once it's deployed there - rather than on the visual studio's local one. It's probably not the best idea to install visual studio on production server at all; or anything else unnecessary, for that matter. The less stuff production server has installed on it, the closer it to the clean o/s, the better.
0
AidenAAuthor Commented:
ok, so, I'm new enough to the world of deploying on the server... how do i debug through IIS... I think you mentioned some stuff about it... but is there something i should read about this? Is it difficult to get working?

These aren't major major sites so i just thought it was easier to run VS on the server to fix problems. I think there shouldn't be any issues except for possible resource issues (from what i understand). So, it would just be a case of debugging at a time when there is not much use on the server? Or there other problems which can happen?
0
Vadim RappCommented:
Make a rule: nothing, absolutely nothing extra on the server, period. Think about it this way: in your car, you can put various accessories here and there, custom mats, air freshener, toy hanging on the windshield; and it's OK. But you don't put any of that into the engine compartment, do you. Same thing. Server is your engine, don't have there anything but the engine itself.

How to enable remote debugging(i.e. to debug the application installed on the IIS on the remote production server from your development machine) - see http://msdn.microsoft.com/en-us/library/bt727f1t.aspx, for one. I searched on google for visual studio enable remote debugging, and got lots of results.

But then again, the best practice is to debug it on your development workstation, and when everything is ready, deploy it on the server. Try this practice with something simple, create a trivial application, polish every step of your development/deployment process, then move to more serious applications.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AidenAAuthor Commented:
ok thanks, I think i have enough information.

Although, I did look into visual studio remote debugging and it looked pretty complicated to be honest. But i'll take another look.

thanks again, Aiden
0
AidenAAuthor Commented:
oh yeah now i remember... think you need msvsmon.exe which only comes with the pro version of VS. But actually i might be able to get that
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.