久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Visual Studio 2017 中的 Javascript 斷點

Javascript breakpoints in Visual Studio 2017(Visual Studio 2017 中的 Javascript 斷點)
本文介紹了Visual Studio 2017 中的 Javascript 斷點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我剛剛安裝了 Visual Studio 2017.在啟動 ASP.NET MVC 應用程序后,我收到消息說 Visual Studio 中的 chrome 調試已啟用.

但我在 Visual Studio 中的斷點不會命中.Razor 代碼上的斷點似乎可以正常工作,但 Javascript 不能.斷點沒有像應有的那樣完全變紅.重新啟動,重建似乎沒有任何效果.

我有以下代碼示例

@Html.Partial("_Test", Model.Test)//調試工作在這里<腳本>變量 i = 1;控制臺.log(i);//調試在這里或上面不起作用</腳本>@section 腳本 {<腳本>變量 a = 11;控制臺.log(a);//調試在這里或上面不起作用</腳本>}

我沒有打開 chrome 調試控制臺,我檢查了 Visual Studio 中已啟用的選項('啟用 Javascript 調試..').

根據這篇博文,我認為這應該可行:注意 JavaScript 文件中的斷點是如何激活的,而 Razor 視圖中的斷點不是.

我還注意到,在當前 Chrome 會話中第一次加載頁面時,在頁面加載期間執行 JavaScript 代碼時,不會為 JavaScript 文件命中斷點.斷點僅在文檔完成加載一次后才起作用.

I just installed Visual Studio 2017. After starting an ASP.NET MVC application I get the message that chrome debugging in Visual Studio is enabled.

But my breakpoints in Visual Studio won't hit. The breakpoints on Razor code seems to be working but Javascript does not. The breakpoints are not fully red like they should be. A restart, rebuild don't seem to take any effect.

I have the following code example

@Html.Partial("_Test", Model.Test) // debugging works here

<script>
    var i = 1;
    console.log(i); // debugging does not work here or above
</script>

@section scripts {
    <script>
        var a = 11;
        console.log(a); // debugging does not work here or above
    </script>
}

I don't have the chrome debugging console open and I checked the option in Visual Studio ('Enable Javascript debugging..') which is enabled.

According to this blog post I thought this should work: https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

Am I missing something here? Could it be that this is not working in Visual Studio 2017 somehow?

I only have one extension and that is Resharper, but I guess this is not an issue.

解決方案

This feature does not work for javascript code inside a *.cshtml file, but only for code in separate *.js (or *.ts) files.

Notice how the breakpoint in the JavaScript file is active, while the breakpoint in the Razor view is not.

I have also noticed that breakpoints will not be hit for JavaScript files when JavaScript code is executed during page load when the page is loaded the first time in the current Chrome session. Breakpoints will only work after the document has finished loading once.

這篇關于Visual Studio 2017 中的 Javascript 斷點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 中文在线一区 | 久久一热| 精品国产一区二区三区日日嗨 | 欧美啊v在线观看 | 久久精品视频免费看 | 中文久久 | 欧美啊v在线观看 | 在线亚洲人成电影网站色www | 在线精品亚洲欧美日韩国产 | 亚洲三区在线观看 | 中文字幕精品一区久久久久 | 午夜影院黄 | 久久国产一区二区 | 狠狠色狠狠色综合日日92 | 中文字幕视频在线观看 | 精品视频国产 | 就操在线| 一本一道久久a久久精品综合蜜臀 | 在线观看国产h | 久久99精品久久久水蜜桃 | 日本成人三级电影 | 四虎伊人 | 午夜影院 | 在线观看涩涩视频 | 一区二区三区四区国产 | 天天草草草 | 国产中文字幕网 | 黄色片在线网站 | 欧美a区 | 99久久精品免费看国产小宝寻花 | 国产免费一区二区三区网站免费 | 日本一区高清 | 久久久久网站 | 颜色网站在线观看 | 午夜在线免费观看 | 日韩av啪啪网站大全免费观看 | a级黄色毛片免费播放视频 国产精品视频在线观看 | 久久久99精品免费观看 | 欧美日韩综合精品 | 久久一区| 久久久久久久国产精品 |