34

I have a gridview on my homepage with a view and an edit link that use query strings to display table data in read-only and editable pages, respectively. I get no error messages from my code, it's simple enough that it doesn't seem to be missing anything, but when I try to debug or view in browser, I get the permanent pinwheel on my status bar and the message "waiting for localhost". What am I missing? Does anyone out there have some experience with this particular issue? I'm using C# and ASP.NET in visual studios with sql server 2008.

Ace Troubleshooter
  • 1,369
  • 6
  • 29
  • 43
  • I've found this exact same problem today - looking forward to the answers – m.edmondson Apr 18 '11 at 14:57
  • 1
    You can try taking a look at IIS logs and SQL Server logs to see what's happening. You can also try turning on ASP.NET tracing. You can also use fiddler to see what's going on with your request. No, I didn't have that problem ever :) – Bogdan Verbenets Apr 18 '11 at 14:59
  • Could be an endless loop in your code. Try breaking in VS and see what's running. – Jamie Treworgy Apr 18 '11 at 16:08
  • 3
    HAHAHAHA!! Oh microsoft, we love to hate you. My trainer came up with a brilliant solution, demonstrating the principle of Foreman's Law (faulty machines won't work until you tell the foreman they don't, and then he/she comes to check them): he shut down VS2010 and restarted it. Problem solved. It's a banner day for my ego, guys. Keep calm and carry on. – Ace Troubleshooter Apr 18 '11 at 16:09
  • 1
    always always try a technical reboot! :) – RYFN Apr 18 '11 at 16:14
  • This has been terrorizing me for a couple years now. Lately it's gotten worse. Sadly none of the workarounds currently in this thread fix the problem. I've tried it all: restart VS, restart IIS, restart SQL, reset/change AppPools, use localhost, don't use localhost, toggle VPN, etc ... nothing seems to truly fix or remedy the issue consistently. For now the only solution have is restarting my machine (VM) but that of course takes a painful 5-10 mins to get all the way back up. Anyhow - if anyone has any other solutions please do share. Obv if I find one I'll share as well. – Christopher May 03 '18 at 09:07
  • I am using entity framework and Database service was down and I made it up and the projuext start working. – Asad Naeem Dec 21 '20 at 10:47

14 Answers14

38

My trainer came up with a brilliant solution, he shut down VS 2010 and restarted it. Problem solved.

Servy
  • 202,030
  • 26
  • 332
  • 449
Ace Troubleshooter
  • 1,369
  • 6
  • 29
  • 43
  • 20
    I know it seems to be an IT joke but its amazing how many times switching it off and on again fixes things – Mauro Feb 24 '14 at 09:14
  • In my case, restarting Visual Studio didn't work, but restarting the machine did work. Maybe restarting the browser would have been enough. – Elliott Beach Oct 22 '19 at 13:41
  • Restarting Visual Studio (VS) also works fine when I use VS Community 2019 and follow the tutorial "Create your first ASP.NET Core web app", https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-aspnet-core-ef-step-02?view=vs-2019 – akawaguc Jul 30 '20 at 14:00
11

Almost sounds like the database connection is going off neverland.

If your timeout on the connection and/or command is set pretty high, like 300 (which is 5 minutes) then it would appear to just hang forever if it is unable to make that connection.

The first thing I'd try is to set the connection timeout to something reasonable like 15 seconds in the web.config.

Then I'd run it again.

Assuming you get a connection failure, I'd use another tool to try and connect to the database using the settings in your web.config.

NotMe
  • 87,343
  • 27
  • 171
  • 245
3

I found that creating a new app pool, then assigning the (already created) web site to it resolved this.

onezeno
  • 764
  • 1
  • 10
  • 21
3

Does this only happen on debug (ie F5)?

If that is the case, my guess is that you are hitting a breakpoint?

If you hit a break point, the browser appears to be dead... but in fact VS is waiting on you to respond...

Ian G
  • 29,468
  • 21
  • 78
  • 92
2

I shut down iis, stopped debugging the site in visual studio, and restarted with F5 ;-)

kfn
  • 620
  • 1
  • 7
  • 26
1

Try to not use localhost but your local ip address.

botenvouwer
  • 4,334
  • 9
  • 46
  • 75
  • I tried this and got "HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory" Is this related? any idea on how to fix it? – Ravid Goldenberg May 05 '15 at 17:24
1

I had the same thing happen; If you are on a VPN connection, you may need to change your web.config file to use your database IP instead of the name (if you have DNS issues with VPN). This won't help the OP but someone else may find this useful.

JackArbiter
  • 5,705
  • 2
  • 27
  • 34
0

This one may seem strange, but it might be caused if you're downloading torrents and your database is on a different server. This seemed to be my problem.

user1534664
  • 3,258
  • 8
  • 40
  • 66
0

I had the same problem, but it was not solved by restarting Visual Studio, or by finding an endless loop. My issue was caused by user authentication failure.

Yesterday I published a web app to my company's server. IT set up the windows authentication for me with IIS, which they did with administrator rights. When I tried to debug my code afterwards I did not have a valid username/password. Instead of just giving a run-time error, the page loaded continuously.

My solution was to comment out the identity line in the web.config file.

    //Comment out the line below
    <identity impersonate="true" password="example" userName="domainName\administrator">
BoxChop
  • 121
  • 1
  • 4
0

If by mistake console.writeline()is used in webform instead of Response.writeline or use console.readline () methods then webform will never display the output and will do processing for ever.

0

I spent SO many hours on this with none of the many suggestions on the web working.

For me... something was causing the file: app_offline.html to be written to the root directory of my project. Instead of showing me the message that the application had been taken offline, etc., it just waited forever with message "waiting on local host".

I removed the file and it suddenly was working again.

Skip Moon
  • 1
  • 1
0

My problem occurred because I had an extra character in web.config.

When I opened up a view it couldn't recognize @model and when hovering over it said where the problem in the web.config was.

Westerlund.io
  • 2,743
  • 5
  • 30
  • 37
0

From a similar question: asp.net waiting for localhost forever

Check firewall for blocked ports, change dynamic ports of application to some fixed port.

Changes in Firewall settings may be a leading cause.

Tyler S. Loeper
  • 816
  • 11
  • 22
0

What helped me was deleting the hidden .vs folder from the root solution directory

Duck Ling
  • 1,577
  • 13
  • 20