简体   繁体   中英

Not able to run ASP.NET web app using Development Server

My development machine (Vista) was working perfectly fine for over a year and then suddenly (without explicitly installing anything) I am unable to run the websites using ASP.NET development server.

The development web server starts fine, but IE cannot display the page:

Internet Explorer cannot display the webpage Firefox says - Failed to Connect, The connection was refused when attempting to contact localhost:49447 .

Here is what I have tried so far:

  • Disabling firewall
  • Stopping anti-virus
  • Stopping Windows Defender

It worked when I stopped all services using MSConfig and tried again. However, that disables most of the services, so is not a feasible long term solution.

After stopping all services, I tried starting services one by one to find out which one is causing problem.

These are the steps and results:

  1. I found DNS Client Service was causing problem.
  2. So I started all others and stopped DNS Client service, but then Network Location Awareness service started causing problem

  3. I stopped DNS Client Service and Network Location Awareness and started all others, btu again something else is causing problem.

Clearly there is something common and fundamental at the root of this.

I do not know much about networking. Can someone guide me in right direction?

Note: I have found another person who is having same problems since this morning. Looks like it could be related to one fo the windows updates? Is anyone else getting affected like me?

I was able to fix this on my computer by doing the following:

My host file contained this line for the localhost entry, which is how the host file ships with Vista, and i've never modified this line::1 localhost

Replaced "::1 localhost" with the this: 127.0.0.1 localhost

"::1 localhost" has worked fine for me for well over a year, until this morning. Windows defender installed two updates, one yesterday and one this morning, my guess is that something in one of these updates caused this entry to not work anymore.

I have solved this problem.

The problem comes because somehow the entry in host file is removed for localhost.

you have to add entry in host file which is kept in System32/etc folder.

just add this at the end of the file.

127.0.0.1 localhost.

save this file and try to ping localhost from cmd prompt.

i think this will resolve your problem.

now try running you website.

All the best.............

The problem comes because somehow the entry in host file is removed for localhost.

you have to add entry in host file which is kept in System32/etc folder.

just add this at the end of the file.

127.0.0.1 localhost .

save this file and try to ping localhost from cmd prompt.

If stopping all the services made it owrk, try stopping one at a time. Eventually you will find out which one it is.

Hopefully someone will know which it is from experience, but if not you can find it yourself.

I also started to get this problem tonight, think I installed a windows update package yesterday.
I'm running VS 2008 (9.0.30729.1 SP) and Vista Ultimate SP1 (32-bit).

Replacing localhost with 127.0.0.1 worked for me.
http://localhost:49227/testsite/Default.aspx
http://127.0.0.1:49227/testsite/Default.aspx

I'm having the same problem. Was working on my website last night, one minute the site worked in the broswers next minute it could not connect to the localhost.

Replacing localhost to 127.0.0.1 worked for me. I'm still inexperienced in asp.net, is there a file where you change

http://localhost:49227/testsite/Default.aspx to

http://127.0.0.1:49227/testsite/Default.aspx

As I am just changing the url in the browsers

This one also worked for me. What I did was:

  1. Go to the Property Page of my Project.
  2. Then under Start Options, look for the Server, instead of 'Use default Web Server', i changed it to 'Use Custom Server'.
  3. Typed the http://127.0.0.1:49227/MyProject/ in the Base Url.

That's it. It automatically opens the site using this link.

Same problem here using visual studio 2008 express

Changed "localhost" to "127.0.0.1" and the page came up. This problem seems to have an effect on internet explorer and firefox

Opera hasn't seen this problem:-)

Grtz

Changing "localhost" to "127.0.0.1" worked well for me, as well.

but just to clarify the whom are not familiar with vista here are the guidelines to change:

  1. Browse to Start -> All Programs -> Accessories
  2. Right click "Notepad" and select "Run as administrator"
  3. Click "Continue" on the UAC prompt
  4. Click File -> Open
  5. Browse to "C:\Windows\System32\Drivers\etc"
  6. Change the file filter drop down box from "Text Documents ( .txt)" to "All Files ( .*)"
  7. Select "hosts" and click "Open"
  8. Make the needed changes and close Notepad. Save when prompted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM