简体   繁体   中英

Visual Studio 2013 : Javascript debugging does not work anymore

Hopefully someone will be able to point me in the right direction. I'm using visual studio 2013 to develop a project using MV4 (VB and Razor) with some javascript libraries (jqWidgets, Knockout, etc.)

Not long ago, I was able to use breakpoint in my javascript code and the debugger worked flawlessly.

One day, it stopped working! Not even the statement "debugger;" work. Code just doesn't stop anywhere.

I'm not sure what happened, I think it is related to the fact that IE automatically upgraded from 10 to 11. Since then, nothing works.

I uninstalled IE 11 and reinstalled IE 10, tried repaired on VS2013, tried removing the last update to VS... Nothing works...

Any idea?

Thank you.

With my soulution is In BundleConfig.cs at the end change

BundleTable.EnableOptimizations = true
 to 
BundleTable.EnableOptimizations = false;

I finally found my problem. It is very silly once you know it.

My debugging problem was due to the way I used BundleConfig.

I created a bundle to package all my script. I change the bundleconfig to explicitly to use the minified version of my script. Instead, I should have used the "*" and let Visual Studio determine if it should bundle the minified or the debug version. I did that when trying to understand how the bundling was working and forgot about the change.

I was using

    bundles.Add(New ScriptBundle("~/bundles/bSoftOptimax").Include(
        "~/Scripts/bSoft/bSoftOptimax.min.js"
        ))

Instead of

    bundles.Add(New ScriptBundle("~/bundles/bSoftOptimax").Include(
        "~/Scripts/bSoft/bSoftOptimax*"
        ))

I didn't remember doing this and debugging stopped working for my javascript.

I think by using "*" you tell VS to create the proper bundle depending if you are debugging or creating an release version of you code.

Thank you your answers, hope this can help somebody else.

Visual Studio 2013 has a cool new feature called Browser Link which makes your life a lot easier. Try from the following and let me know how it goes: http://www.asp.net/visual-studio/overview/2013/using-browser-link

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM