Visual Studio 2013浏览器链接不适用于空ASP.NET项目?

时间:2013-07-04 10:04:46

标签: visual-studio-2013

我想知道Browser Link的最低要求是什么。

我使用Visual Studio 2013 Preview和Web Essentials全新安装了Windows 8.1 Preview。

我能够让Browser Link使用新的ASP.NET SPA项目,但是当我创建一个新的ASP.NET Empty项目时,添加了一个index.html页面并运行Internet Explorer 11设置为默认值不工作。

浏览器链接工具提示一直说No Browser is connected。我也试过其他浏览器,包括Chrome,但没有成功。

我在其他地方读到web.config文件必须将debug设置为'true'。

有什么建议吗?也许我误解了一些依赖关系或使用新功能的情况。

6 个答案:

答案 0 :(得分:5)

您是否在web.config中添加了<modules runAllManagedModulesForAllRequests = "true" />?默认情况下,浏览器链接不适用于HTML页面。

请在此blog中查看“预览的已知浏览器链接问题”部分。

顺便说一句,它只是在web.config中添加它不起作用。我做了一个空的aspx页面。我首先开始调试aspx页面,然后输入html页面的url,这样Browser Link就可以了。

希望这有帮助。

答案 1 :(得分:0)

浏览器链接在封面下使用SignalR,因此它有一些依赖关系:

  1. 一个相对现代的浏览器(几乎所有来自IE 7及以后的东西)
  2. 要在浏览器上启用JavaScript
  3. The ability for the the browser to talk back to the computer running VS, which is acting as a server. Firewalls/proxies could hurt this.
  4. 我的直觉说,因为是SignalR,它有一台服务器,服务器需要运行ASP.NET&amp;因此需要运行时间位才能工作。这可能是你的问题。
  5. 此外,web.config文件需要

    1. Debug set to true

答案 2 :(得分:0)

正如Kazuhiko所指出的,您需要IIS处理静态文件。这可以通过添加:

来完成
 <modules runAllManagedModulesForAllRequests="true" />

web.config。因此,例如,TypeScript项目的web.config文件如下所示:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>
  <system.webServer>
    <!-- Enable BrowserLink -->
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
</configuration>

答案 3 :(得分:0)

在Windows 8.1 with Update和Visual Studio 2013上。

我确实需要:

  • debug =“true”在web.config
  • 运行.NET 4.0或更高版本。
  • 运行razor v2或更高版本。
  • 然后重新启动Visual Studio(这对我来说很糟糕)。

我不需要:

<modules runAllManagedModulesForAllRequests="true" />
<handlers>
    <add name="Browser Link for HTML" ... />
</handlers>

答案 4 :(得分:0)

对于VS 2013.单击“浏览器”按钮向下箭头以选择浏览器 1. Click the Browser button down arrow to choose browser(s)

  1. Select your Browser(s) and then click the Browse button. You also can select the browser size.选择您的浏览器,然后单击“浏览”按钮。您也可以选择浏览器大小。
  2. 单击主菜单上的“查看”。单击“其他Windows”,然后转到“浏览器链接仪表板”

    1. Click Other Windows and then go to Browser Link Dashboard 仪表板应显示在“解决方案资源管理器”窗口下。如果没有,请单击主菜单上Windows选项卡下的重置窗口布局。

    2. Notice the Project name and the number of connections based on the browsers you choose根据您选择的浏览器注意项目名称和连接数

    3. 5. Click the down arrow next to the browser you selected to see options to edit your contents in your browser - Design, Inspect or Save点击您选择的浏览器旁边的向下箭头,查看在浏览器中编辑内容的选项 - 设计,检查或保存

      6. Your URL points to your web site. You can type that directly into the browser for each browser you have.您的网址指向您的网站。您可以直接在浏览器中为每个浏览器输入该文件。

答案 5 :(得分:0)

以上对我没有用,但我发现了这个:

来自http://itq.nl/short-visual-studio-2013-browser-link-tip/

<handlers>
  <!-- needed for browser link and html pages-->
  <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>

<!-- needed for browser link and html pages-->
<modules runAllManagedModulesForAllRequests="true">     
</modules>

我需要两个部分才能工作。

之后我注意到点击刷新按钮有时会询问我是否要停止调试。我只是点击了肯定,它似乎在那之后愉快地工作了