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

3

23

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.

Encrata answered 1/1, 2016 at 23:49 Comment(0)
N
7

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.

Napkin answered 23/2, 2016 at 17:56 Comment(6)
Thank you so much!! That was exactly the issue. I repaired RC1 update 1 from control panel as instructed in the link issue #3 and it worked.Encrata
@da_elysian_fields Does it work for static files yet? see stackoverflow.com/questions/29011607Strychnic
I had this issue except I hadn't yet installed Web Essentials - I didn't know it was required, since this functionality appeared to be installed. After repairing, It would 'connect' to the browser, but the actual syncing between the F12 developer tools and the designer wasn't working. Installing Web Essentials was the final piece.Auspice
I have the same issue on my vs2015 core update 3. asp.net application. I read the link of the known issues u sent. However, no "Microsoft ASP.NET 5" in my programs list of the "control-panel".Immaculate
Link goes to 404. This is why it's a good idea to describe the solution in your answer rather than just link to it.Aalborg
Your answer is now obsolete, because you only added a link is broken and you didn't quote the essential parts. DownvoteErleneerlewine
F
2

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>
Facet answered 28/11, 2016 at 20:50 Comment(0)
N
0

Do you have the same version of "ASP.NET and Web Tools" installed on both of the computers? You can check in Visual Studio by going to "Help->About Microsoft Visual Studio" and looking for something like "ASP.NET and Web Tools 2015.1" in the Installed Products list.

Over time there have been breaking changes in the ASP.NET 5 runtime, and the Browser Link support in Web Tools needs to change to keep up. As a result, if the Web Tools version doesn't match the version your project is targeting (e.g. Beta8 vs. RC1) then Browser Link will fail to connect.

That's the most likely reason why it would work on one computer but fail on another.

Napkin answered 18/2, 2016 at 17:45 Comment(3)
Yes the version are same in both computers. I currently Have ASP.NET 5 RC1 with Update 1 and Web Essential Version 1.0.27Encrata
Realsed there is a new extension for "browser reload on save" here: visualstudiogallery.msdn.microsoft.com/… This extension is also not working for me in the laptop where BrowserLink is not working..Encrata
If you try catching all exceptions when you run your website, do you see any with "BrowserLink" in the callstack?Napkin

© 2022 - 2024 — McMap. All rights reserved.