2013-07-04 73 views
10

我想知道瀏覽器鏈接的最低要求是什麼。Visual Studio 2013瀏覽器鏈接不適用於空的ASP.NET項目?

我使用Visual Studio 2013預覽版和Web Essentials全新安裝了Windows 8.1預覽版。

我已經能夠使Browser Link與新的ASP.NET SPA項目一起工作,但是當我創建一個新的ASP.NET Empty項目時,添加了一個index.html頁面,並將Internet Explorer 11設置爲默認它不起作用。

瀏覽器鏈接工具提示不斷說No Browser is connected。我也嘗試過使用其他瀏覽器,包括Chrome,但沒有成功。

我在其他地方看過,web.config文件的debug必須設置爲'true'。

有什麼建議嗎?也許我誤解了一些依賴或使用新功能的情況。

回答

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 &因此需要日運行時間可以讓他們工作。這可能是你的問題。

另外web.config文件需要

  1. Debug set to true
5

您是否在web.config中添加了<modules runAllManagedModulesForAllRequests = "true" />?瀏覽器鏈接在默認設置下不適用於HTML頁面。

請檢查此blog中的「已知瀏覽器鏈接問題的預覽」部分。

順便說一下,它不工作只是將其添加到web.config中。我做了一個空的aspx頁面。我首先開始爲aspx頁面進行調試,然後鍵入html頁面的url,以便Browser Link正常工作。

希望這會有所幫助。

0

正如Kazuhiko指出的那樣,您需要由IIS處理靜態文件。這可以通過添加:

<modules runAllManagedModulesForAllRequests="true" /> 

到您的web.config。因此,舉例來說,我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> 
0

在Windows 8.1更新和Visual Studio 2013。在web.config

  • 運行.NET 4.0或更高

    • 調試= 「真」:

      我確實需要。

    • 運行剃鬚刀v2或更高版本。
    • 然後重新啓動Visual Studio(這是我的陷阱)。

    我並不需要:

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

    對於VS 2013點擊瀏覽器按鈕向下箭頭來選擇瀏覽器(一個或多個) 1. Click the Browser button down arrow to choose browser(s)

  • Select your Browser(s) and then click the Browse button. You also can select the browser size.選擇您的瀏覽器,然後單擊瀏覽按鈕。您也可以選擇瀏覽器大小。
  • 點擊「查看」主菜單上。點擊其他窗口,然後進入瀏覽器鏈接儀表盤

  • Click Other Windows and then go to Browser Link Dashboard 儀表板應Solution Explorer中出現下窗口。如果沒有單擊主菜單上Windows標籤下的重置窗口布局。

  • Notice the Project name and the number of connections based on the browsers you choose公告項目名稱和基於瀏覽器的連接數你選擇

  • 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.您的網址指向您的網站。您可以直接在瀏覽器中輸入每個瀏覽器的內容。

    +1

    步驟3顯示沒有連接對我來說... –

    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> 
    

    我需要兩個部分爲它工作。

    我注意到之後,點擊刷新按鈕有時會問我是否要停止調試。我只是點擊是,它似乎愉快地工作後

    相關問題