Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Essentials Browser Link not Working in Visual Studio 2015 for only ASP.net 5 applications

Tags:

Installed Web Essentials in my new computer but I cannot get Browser Link working with ASP.NET 5 / MVC6 web Applications projects. Works Fine with ASP.NET 4.5 however. This is what I have tried so far.

My project.json has following dependencies already when I create the project

 "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final" 

My Startup.cs class also already has configured BrowserLink (I am running in DEV env)

if (env.IsDevelopment()) {    app.UseBrowserLink();    app.UseDeveloperExceptionPage(); } 

I have enabled Browser Link form toolbar

Enabled Browser Link from toolbar

Non worked.. When I run the app pressing F5, the browser link dashboard doesn't detect any browser. says 0 connections.

enter image description here

I have also tried uninstalling Web Essentials and reinstalling. Also tried using Web Essential Nightly build.

Re-intalling Visual Studio did not helped either.

Anything else that I might be missing? I am using VS2015 community on Windows 10 machine. I have another computer with similar setup works fine in that computer. I tried creating project in My other computer where browser link was working and copied the project to this computer, That did not help either.

like image 902
Sunil Shahi Avatar asked Jan 01 '16 23:01

Sunil Shahi


People also ask

What is enable browser Link?

Browser Link uses SignalR to create a communication channel between Visual Studio and the browser. When Browser Link is enabled, Visual Studio acts as a SignalR server that multiple clients (browsers) can connect to. Browser Link also registers a middleware component in the ASP.NET Core request pipeline.

What is Browserlink in Visual Studio?

Browser Link is a new feature in Visual Studio 2013 that creates a communication channel between the development environment and one or more web browsers. You can use Browser Link to refresh your web application in several browsers at once, which is useful for cross-browser testing.

What's new in. net 4. 5?

ASP.NET 4.5 adds support for performing flushes asynchronously using the BeginFlush and EndFlush methods of the HttpResponse class. Using these methods, you can create asynchronous modules and asynchronous handlers that incrementally send data to a client without tying up operating-system threads.


2 Answers

Oh, I just remembered. It could be related to known issue #3 here: https://github.com/aspnet/Tooling/blob/master/known-issues.md


EDIT: The link above is broken now because it referred to a setup bug in a prerelease version of the ASP.NET 5 tools, which is obsolete and no longer available. If you are using ASP.NET Core with VS 2015 and Browser Link doesn't work, it's not because of this issue.

However, if you have the old release and you are hitting this issue, the fix was to find the ASP.NET 5 bundle in Add/Remove Programs, and "Repair" it.

like image 91
Joe Davis Avatar answered Nov 04 '22 10:11

Joe Davis


This may not work for you but others seeking this solution. If you are running static html pages, such as with AngularJS, then you need to add some code into your webconfig. The information can be found on this page:

https://www.asp.net/visual-studio/overview/2013/using-browser-link

for quick reference, just make this is in the webconfig:

<configuration>   <system.webServer>         <handlers>       <add name="Browser Link for HTML" path="*.html" verb="*"             type="System.Web.StaticFileHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"             resourceType="File" preCondition="integratedMode" />     </handlers>   </system.webServer>     </configuration> 
like image 21
Exzile Avatar answered Nov 04 '22 10:11

Exzile