简体   繁体   English

Visual Studio 2013:Javascript调试不再起作用

[英]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.) 我正在使用Visual Studio 2013开发带有MV4(VB和Razor)以及一些JavaScript库(jqWidgets,Knockout等)的项目。

Not long ago, I was able to use breakpoint in my javascript code and the debugger worked flawlessly. 不久前,我能够在JavaScript代码中使用断点,并且调试器可以完美地工作。

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. 我不确定发生了什么,我认为这与IE自动从10升级到11有关。

I uninstalled IE 11 and reinstalled IE 10, tried repaired on VS2013, tried removing the last update to VS... Nothing works... 我卸载了IE 11,然后重新安装了IE 10,尝试在VS2013上进行修复,尝试删除对VS的最新更新。

Any idea? 任何想法?

Thank you. 谢谢。

With my soulution is In BundleConfig.cs at the end change 我的解决方法是在结束时在BundleConfig.cs中

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. 我的调试问题归结于我使用BundleConfig的方式。

I created a bundle to package all my script. 我创建了一个捆绑包来打包所有脚本。 I change the bundleconfig to explicitly to use the minified version of my script. 我将bundleconfig更改为显式使用脚本的缩小版本。 Instead, I should have used the "*" and let Visual Studio determine if it should bundle the minified or the debug version. 相反,我应该使用“ *”并让Visual Studio确定是否应捆绑缩小版或调试版。 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. 我不记得这样做了,并且调试停止为我的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. 我认为通过使用“ *”,您可以告诉VS创建正确的捆绑软件,具体取决于您是调试还是创建代码的发行版本。

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. Visual Studio 2013具有一个很酷的新功能,称为“浏览器链接”,可以使您的生活变得更加轻松。 Try from the following and let me know how it goes: http://www.asp.net/visual-studio/overview/2013/using-browser-link 请尝试以下操作,让我知道它的运行方式: http : //www.asp.net/visual-studio/overview/2013/using-browser-link

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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