2

After extensive google-fu I still can't get this working...

I'm trying to do it on an ASP.NET Empty Web Site...

enter image description here

Running VS 2013 as administrator, updated web.config file,

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

    <system.webServer> 

      <staticContent>
        <mimeMap fileExtension=".json" mimeType="application/json" />
      </staticContent>

      <!-- Enable BrowserLink -->
      <modules runAllManagedModulesForAllRequests="true" />

      <handlers>
        <!--<remove name="BlockViewHandler"/>
        <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />-->

        <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>

    <appSettings>
      <add key="vs:EnableBrowserLink" value="true"/>
    </appSettings>

</configuration>

browse with,

enter image description here

select multiple browsers click browse.

enter image description here

The browsers open and the page runs ok on all, but refresh linked browsers is disabled,

enter image description here

browser link dashboard shows no connections...

enter image description here

How do I make this work?

EDIT: I found a solution as per my answer below but, if anyone can help me to understand whats going on, or direct me to a good knowledge source, that would be great.

Cool Blue
  • 201
  • 1
  • 14

1 Answers1

2

I stumbled across the solution but I don't have the knowledge to understand why it works like this...

First of all it's not necessary to run VS in administrator mode.

Second, there are two minimum web.config options...

<configuration>

    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

    <system.webServer> 

      <!-- ***EITHER***Enable BrowserLink will run after one refresh with only this!-->
      <modules runAllManagedModulesForAllRequests="true" />

      <handlers>

        <!-- ***OR*** Enable BrowserLink will run after one refresh with only this!-->
        <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> 

Third, after running the page (using Browse With... OR directly), the page needs to be refreshed once in one browser. After that it runs fine for the rest of the VS session.
The first time it loads, the Browser Link html is there but the script fails to load.
enter image description here
But after one refresh of the page in any of the browsers that are running it, everything works... for the rest of the VS session. Next time I start VS I have to repeat the process.

Cool Blue
  • 201
  • 1
  • 14