Browser Link always asking for "Do you want to stop debugging"
Asked Answered
T

2

15

Just wondering my browser keeps asking if I want to stop debugging every time I hit browser link refresh very annoying as is slowing down devtime.

Has anybody else come across this?

cheers

Triangulate answered 11/3, 2014 at 11:39 Comment(2)
I'm seeing this issue with VS 2017 Community after updating to the most recent version even though in prior version of VS 2017 Community it was working fine.Trike
I have the same issue here, do you have any update on this ?Dextrality
T
16

Updated Answer, Root Cause Now Found
After what is now TWO years of seeing this error on and off I finally understand what's causing this. A BIG Thank you goes out to Damian Edwards for mentioning this in a community stand-up!

As a developer, we often do all of our development in Visual Studio in Debug mode rather than release mode. And it's very common for us to run our projects with F5. In this case VS runs the project with the debugger enabled, no surprise there.

So it turns out, the "Do you want to stop debugging? error dialog when you try to refresh via browserlink is saying is "Hey you made some changes that look like they might require recompiling the razor view in order to refresh the page, and in order to do that Visual Studio needs to stop the debugger session, is that OK?"

And the fix? This is gonna blow your mind. When you want to use browser link to rapidly refresh the page while doing html/css changes and never see this message again, do this: run the project using CTL+F5 instead of F5. This will run the project without firing up the debugger and you probably weren't gonna use the debugger anyway if you were planning on doing a bunch of html css work on a view using browerlink. :-) That's it, no more error message. Bam. You're welcome. (It took me T W O Y E A R S to figure that out. Hand against forehead, eyes rolling)

I have left my original answer below because it did seem to help in some cases and it has already received a couple upvotes, but in hind sight, I think it was more of a coincidental observation than a root cause..

Original
I have been struggling with this issue for nearly a year. I may have just discovered the cause. I was running two copies of visual studio, each with different web projects, at the same time. Then when I try to get browserlink to refresh the browser in one copy of visual studio it asks “Do you want to stop debugging”.

I then quit out of the 2nd copy of visual studio, and re-ran the web project in the first copy of visual studio and when I tried to get browserlink to refresh the browser it worked fine with no prompt. Yea. A better error message than “Do you want to stop debugging” might have been "It looks like you are running two web projects at the same time in different copies of visual studio. Browserlink does no support this, please close one of them."

Trike answered 14/12, 2018 at 15:57 Comment(4)
I was one of those up votes but came back to this as I was still having the issue. Thanks for the update, up vote again :)Katey
Had a feeling it was razor views. But I dismissed the notion, because I'm only editing a vue component (no changes to the razor view at all) and it still occurs. I'll give CTRL-F5'ing a shot, though. Would be nice to be rid of the popup. It's occurrence still seems fairly random to me.Adalard
@Adalard it's occurrence seemed pretty random to me too, but like most programming things, it's not random, it's just hard to see the pattern.Trike
Nou doubt about it. But the CTRL-F5 tip works well for me, so I'm not gonna bother to detect the pattern. Tnx!Adalard
V
0

You may want to check out this post: https://mcmap.net/q/824925/-is-visual-studio-39-s-browser-link-feature-able-to-use-web-sockets. If you are using an older version of IE (like IE9), then long-polling may be the issue.

Short answer

Browser Link will only use WebSockets on Windows 8 or Windows Server 2012

Longer answer

The following would explain the issue if you're using Visual Studio on Windows 7, Windows Vista or Windows Server 2008:

IIS (Express) depends on the .NET framework implementation in System.Net.WebSockets to handle WebSocket connections; as you can read in the link to MSDN, you simply don't get an actual implementation of the necessary classes when you install .NET 4.5 on Windows 7.

So in that case, the server can't agree to the client's request to change from standard HTTP to the WebSocket protocol, which forces the SignalR client to use one of the fallback options (in your case: long-polling).

Vann answered 1/10, 2014 at 14:13 Comment(1)
@Pokechu22 and author, if you believe the question is a duplicate, please flag as such. It's better to not copy answers around the site.Erund

© 2022 - 2024 — McMap. All rights reserved.