Search code examples
visual-studio-2013browser-link

Browser Link - Connection Actively Refused


EDIT I believe now the problem lies in the fact that Visual Studio is not launching the server (or whatever it is) for the browser to call back to. I do not know if this is some service, its dependencies, or anything else about it!

Original When running a MVC project in VS 2013, my Browser Link is not working correctly. The problem is that the URL to the browser link javascript file is being actively rejected.

An example message from fiddler:

[Fiddler] The connection to 'localhost' failed. <br />Error: ConnectionRefused (0x274d). <br />System.Net.Sockets.SocketException No connection could be made because the target machine actively refused it 127.0.0.1:27244

I've verified the following:

  • Same project works fine on other machines
  • The site itself works (on a different port)
  • vs:EnableBrowserLink is absent from web.config
  • Browser LInk is enabled
  • debug is set to true
  • The <!-- Visual Studio Browser Link --> portion is rendered in the page, thus confirming (even more so) that the browser link is enabled.
  • Read every article on how to use Browser Link - none detail what happens if the connection to the script is refused
  • Same exact problem on all browsers
  • Same exact problem on all web projects (I've tried several, even fresh 'vanilla' one)
  • Restarting VS, computer, doesn't fix
  • Running VS as admin doesn't fix
  • Running in Safe Mode doesn't fix
  • Disabling all VS extensions doesn't work
  • Running 'repair' on VS also does not work
  • The port that it's attempting to reach (in my example, 27244) does not show up at any of the IP addresses in netstat -aon
    • To me this means it fails to start
  • Firewall (even the corp one) is not blocking any of these ports
  • Procmon and Procexplorer reveal nothing I can understand to be as to why VS is not starting the SignalR process(es).
  • A brand-new project w/ SignalR from NuGet works fine - there must be something different on how VS uses it interally

I don't understand how the port it uses is generated, but it's different for every project.

I understand that Browser Link uses SignalR on the insides, but my research on that and connection refused leads me just enable port 80, which obviously won't help.

What else could it be? Any ideas? Where can I check?


Solution

  • Unfortunately, I was unable to pinpoint the exact reason... however, my problem has been solved. Uninstalling and reinstalling Visual Studio entirely didn't seem to help. What finally seemed to help was assigning port 44399 to a port on my local IIS. This forces Visual Studio to use a different port, 44398, and from that point on Browser Link started working.

    I'm left to assume that the SignalR server was unable to start due to that port being inaccessible, although I am not sure why.