Browser Link - Connection Actively Refused - visual-studio-2013

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?

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.

Related

Connection timeout issue in Visual Studio Code

I have been facing some weird connection timeout issues in Visual Studio Code.
I am writing a simple web crawler to read a website using the requests and beautifulsoup4 packages in Python. I don't have any problem opening the URL in my web browsers (opens fine in Edge and Chrome), but when I say request.get(url), then the request always times out. Also, when I try to install some additional packages using pip, it always times out. But the corresponding PyPI page opens fine on my web browser.
The funny thing is - I am facing this issue only when I work out of my company's office. I don't have this issue at all when I am working from my home. There shouldn't be a system-wide firewall or a network firewall, because if there is, then the sites shouldn't be opening on my browsers too, right?
I went to VS Code Preferences and checked the settings there. There's no proxy set up. There is nothing specifically that would block network requests from inside VS Code. Here are some screenshots showing what VS Code Settings looks like.
I looked online and couldn't find much, since every question out there is regarding timeouts in SSH connections, which isn't relevant to me here. This official site here gives a bunch of URLs that need to be allowed by the firewall for VS Code to be able to connect to the network, but I don't know where to add them.
Is there something that I am missing? Any leads on how I can debug this issue? Or is it something that I'll have to take up with my company's network administrator?
TIA.

Ran into a really weird problem with running localhost

I started having this issue yesterday, but suddenly I'm unable to run even basic projects. The project starts as expected, but then the browser always shows this in microsoft edge. This is literally the boiler plate project generated when making a new application. Has anyone else run into this problem and came up with a solution?
This is what I got my features set to...
Edit 1:
I've been able to confirm that I do not have the issue with older .NET Framework projects running off of IIS Express. The issue seems to be purely when trying to run .NET Core applications using Kestrel.
Edit 2:
Went back and tried to change the port number to see if that made a difference. Unfortunately, it didn't seem to do anything. (Swapped port number 5001 to 5501 just to see if it would load the template website.)
Also checked to see what is going on when trying to run the template program. I can see port 5001 appear, but the state is TIME_WAIT and it never gets to established.
Edit 3:
When I start the .net core app it does get this far on the server...
Going back in time, the last thing I was doing before this problem started was creating a new user for my local SQL Server as well a setting up a database. I had already installed SSMS and didn't have any issues before that point, but I'm unsure how setting up a new user for a specific database on the SQL Server in SSMS would cause this problem.
I used Code first migrations via command line EF tools. I'm pretty sure this isn't related, as the problems began before I got to this point.
EDIT 4:
I tried accessing the default site via IP instead of using localhost. Oddly, 127.0.0.1:5001/mycontroller works, but trying to access it via localhost:5001/mycontroller does not work.
Edit 5:
I ran a test to see if a .net framework project can successfully launch and show up on localhost to make sure the issue is strictly with .NET Core applications using Kestrel. As it turns out, running an older .NET Framework style project on IIS Express does work on localhost.

Can't access microsoft.com and skype.com web site after installing VS2013 Preview

Recently i installed Microsoft Visual Studio 2013 Preview Ultimate on Windows 7. Everything went smoothly except now i can't access www.microsoft.com and www.skype.com anymore. Tried latest IE10 and FireFox, both show blank page when accessing the above mentioned web sites. Firefox in its left bottom corner shows that it is waiting for ajax.aspnetcdn.com.
I'd really like not to reinstall OS on my machine, so i'd appreciate any idea how to fix this. For myself i tried to stop Firewall service and disable MS Security Essentials runtime protection, neither helped.
PS: I can access www.microsoft.com and www.skype.com from another machine in the same local network
UPDATE: i am using tfs.visulstudio.com as my TFS server and it opens fine if i am not signed in. But once i am trying to log in it opens blank, like browser is waiting for something (the same as for microsoft.com and skype.com). Something related to live ID?
Don't think this is the website to post this kind of question but try uninstalling VS2013 preview because you think that's causing the problem. Search in Google for people getting similar problem. I also don't think it is VS2013 because I can't think of anyway of how VS2013 would somehow disable you from going to a certain website. Make sure the sites weren't down at the time or if you're having something kind of Internet server issues.
skype is owned by microsoft, so you can't enter both microsoft pages. This could be related with some kind of ISP (Internet Service Provider) and not with VS2013, or you can try rebooting your router. Last thing i would do is traceroute both address and see where they fall.
I wanted to write this as a comment but I don't have enough reputation yet. Anyway, obviously trying to uninstall the program and trying again would be a good start as already mentioned, but you should also look inside your hosts file for any weird redirections some virus of malware might have set up. It's located at "C:\Windows\System32\drivers\etc" and you can open this inside notepad (might require notepad to be run as an administrator). Check to see if skype.com or microsoft.com are in there and are pointing to a different IP address. If they are you can just remove them and save the file (might require a restart to take effect). If still no luck you should try a livecd of a linux distro to make sure the problem is definitely inside your windows somewhere.
Let us know how it goes.

VS2010 specific port changes at random

I'm playing around with a WCF service.
The problem I'm having is that VS2010 keeps randomly assigning a new port number to it when starting the VS Development Server even though I have set it to a specific port through the project settings.
If I keep stopping and starting VS Development Server for a few times with this problem, I get an error that says Unable to launch the ASP.NET Development server because port 'xxxx' is in use.
Why is this happening?
edit: It was suggested that this could be caused by the Dev Server not stopping. Unfortunately, it happens on a freshly started computer as well, i.e. when no instances of it are running at all.
Also, after I get the error message, it doesn't matter if I change the port, or select the Auto-assign Port option. The result is the same.
I have seen it sometimes and it seems that the webserver doesn't stop at times. So next time you fire up your project, the previous server is running at the same port.
The solution is to explicitly close the previous one and retry.
On the project properties of the web app project (right click and select Properties) Web tab, change the radio button to 'Specific Port' from auto select. That should make the port number totally consistent.
It turns out that the problem was linked to the issue answered at Visual Studio Development Server using wrong port.
I didn't suspect this to be the cause because I didn't have a blanket problem. I could launch the WCF solution at times, but not at certain other times. I could also run an instance of the Dev Server for an MVC solution with a specific port applied without problems.

ASP.NET websites under IIS 7.5 (Windows 7) running extremely slow

I've just installed Windows 7 x64 Ultimate on my desktop PC. I installed IIS, Visual Studio 2008, registered ASP.NET, etc.
I have this ASP.NET 3.5 website I'm working on running EXTREMELY slow on this new IIS. On STA and PROD servers (Windows 2003 Server) and on my old XP/IIS 5.1 everything runs smoothly.
A page which usually takes 1-2 seconds to load is taking 8 seconds!!!
I saw this post on IIS forum. It says something about Vista/7 not pooling connections (just to let you know, the website is running locally but it's connecting to a SQL Server 2005 hosted on a remote server).
It seems that it takes a while to "start loading" the page... I mean, I click refresh and it stays for several seconds "Waiting for localhost"... Then when it gets response it loads the whole page normally...
I don't have a clue how to force Win7/IIS7.5 to pool database connections.
EDIT: I've created a new empty ASP.NET web application to see if the problems happens too. The answer is no, it responds fast as it should with an empty default page. Maybe is something related to the DB connection. I will do a further test. It should be a way to fix it...
EDIT 2: Debugging the app I noticed that the delay occurs AFTER the execution of .NET code (Page_Load, etc)... so the delay seems to be somewhere when IIS serves the page to the browser.
For those having the same problem, here's two possible solution.
1) Disabling IPv6 support in Firefox (only for Firefox)
Most of the authors that I found out about suggest this approach as quickest and cleanest solution. What you need to do is basically to open configuration settings in Firefox (about:config) and to change network.dns.disableIPv6 setting to true.
2) Change localhost settings in your hosts file (all browsers)
This came to me as an idea to check where and how can I interfere in IPv6 settings on my machine. I saw one of the comments on above mentioned sources saying that one can get rid of the problem by simply replacing localhost with machine name in the url.
It didn’t take me long to check and see that disabling my IPv6 localhost lookup does the same thing as disabling IPv6 directly in Firefox.
What you need to do is basically to comment / delete this particular line in your hosts file:
#::1 localhost
Note: ::1 notation is IPv6 equivalent of the IPv4 127.0.0.1 lookup address.
I believe the second solution might be more suitable for users who do not want to disable IPv6 in general, and the first one for all others that still do not use IPv6 in their regular work.
I was having the same issue: extremely dead slow site performance using IIS 7.5 on Windows 7 64-bit with a Core 2 Duo with 4GB RAM and 3 Application Pool Processes running only 1 website. Here's what I did to get the speed back to IIS, problem solved...
The trick for me was to run IIS using 32-bit workers, as instructed by Microsoft on IIS.net, which you can read here:
http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/
Simple solution provided (I don't want to rewrite it here)... Either you can run a 1-line command from the Windows Command Prompt or a 1-line command from Windows PowerShell. I just ran it from the command line (make sure you open Command Line or PowerShell as Administrator -- right-click > Run as Administrator).
Thanks,
Marty McGee
You can try running multiple processes as application pools:
Open IIS
Click Application Pools
Right click the app pool for your app
and click Advanced Settings
Find the
"Maximum Worker Processes" and update
it to 3 (or the number of processes
you want to allow to run).
I know the op was running IIS 7.5 and this may not apply to him, but I'm posting this as it might help others running IIS Express 8.0. I had the same problem and none of the IPv6 or hosts file changes worked for me. My asp.net MVC4 project was really slow after hitting F5 to refresh js changes on localhost. It was happening across all browsers - Chrome, FF, and IE. Eventually I discovered that IIS Express 8.0 is extremely slow when serving up js files and seems to be a bug. If I ran iisexpress on the command line and hit F5 I could see each js file took 4 or 5 seconds to load.
I ended up uninstalling IIS 8.0 and installing IIS express 7.5 and straight away the problem was fixed. Here are the steps I followed:
Uninstall IIS express 8.0
Delete the IISExpress folder (on Win 7 it's in My Documents\IISExpress)
Install IIS express 7.5 (Link to IIS Express 7.5 download)
IIS Express 8.0 seems to be installed with VS 2012 so if you had a new install or possibly a service pack update this might upgrade the previous IIS Express version.

Resources