Visual Studio 2013 无法在 cshtml 中调试 javascript [英] Visual Studio 2013 can't debug javascript in cshtml

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

问题描述

我有一个使用 Visual Studio 2013 创建的 ASP.NET Web 应用程序.我正在尝试调试 CSHTML 文件中的 JavaScript.但是,每当我启动网页时,任何断点都会变成红色圆圈箭头并指出当前不会命中该断点.调试器目标代码类型的可执行代码没有与此行相关联.可能的原因包括:条件编译,编译器优化,或者当前调试器代码类型不支持此行的目标架构."

I have an ASP.NET Web Application created with Visual Studio 2013. I am attempting to debug JavaScript in a CSHTML file. However, whenever I launch the webpage, any breakpoint turns into a red circle arrow and states, "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line. Possible causes include: conditional compiliation, compilier optimizations, or the target architecture of this line is not supported by the current debugger code type."

最近项目转为支持MVC和RAZR,这两个我都不知道,这也是这个问题开始的时候.但是,搜索这些结果并不能解决我的问题.

Recently, the project was switched over to support MVC and RAZR, neither of which I know well, and this is exactly when this issue began. However, searching those have yielded results that don't fix my issue.

Web.config:

Web.config:

<compilation debug="true"...>

我知道我可以使用 Firebug 或其他一些浏览器工具调试 JavaScript,但我更愿意坚持使用 Visual Studio 的调试,因为这是我的习惯.

I know I can debug JavaScript with Firebug or some other browser tool, but I would much rather stick with Visual Studio's debug as that is what I am used to.

推荐答案

所以,显然这是一个已知问题",将尽快修复.对某些"人有效的临时解决方法是确保任何 Javascript 都在一个单独的文件中.

So, apparently this is a "known issue" that will be fixed as soon as possible. A temporary work around that works for "some" people is making sure any Javascript is in a separate file.

这是由于 RAZR 和 Javascript 位于同一文件中,并且 Visual Studio 2013 无法在该实例中处理调试.

It is caused by having RAZR and Javascript in the same file and Visual Studio 2013 not being able to handle debugging in that instance.

这篇关于Visual Studio 2013 无法在 cshtml 中调试 javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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