Visual Studio 2013:Javascript调试不再工作 [英] Visual Studio 2013 : Javascript debugging does not work anymore

查看:131
本文介绍了Visual Studio 2013:Javascript调试不再工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人能指出我正确的方向。我正在使用visual studio 2013来开发一个使用MV4(VB和Razor)的项目,其中包含一些javascript库(jqWidgets,Knockout等)。



不久前,我能够在我的JavaScript代码中使用断点,并且调试器无瑕疵地工作。



有一天,它停止工作!甚至没有声明调试器工作。代码只是不会停在任何地方。



我不知道发生了什么,我认为这与IE自动从10升级到11的事实相关。此后,没有任何工作。



我卸载IE 11并重新安装IE 10,在VS2013上修复,尝试删除最后一次更新到VS ...没有任何工作...

任何想法?



谢谢。

解决方案

我终于找到了我的问题。一旦你知道这是非常愚蠢的。



我的调试问题是由于我使用BundleConfig的方式。



我创建了一个软件包来打包所有我脚本。我将bundleconfig更改为使用我的脚本的最小化版本。相反,我应该使用*,并让Visual Studio确定是否应该捆绑最小化或调试版本。我试图了解捆绑是如何工作的,忘记了这个变化。



我正在使用

  bundles.Add(New ScriptBundle 〜/ bundles / bSoftOptimax)包含(
〜/ Scripts / bSoft / bSoftOptimax.min.js
))

而不是

  bundles.Add(New ScriptBundle(〜/ bundles / bSoftOptimax)包含(
〜/ Scripts / bSoft / bSoftOptimax *
))

我不记得这样做,调试停止为我的javascript。



我认为通过使用*,你告诉VS创建正确的包取决于您正在调试或创建发行版本的代码。



谢谢您的答案,希望这可以帮助别人。


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.

解决方案

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:Javascript调试不再工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆