A breakpoint could not be inserted at this location - VS 2015 only JavaScript files

僤鯓⒐⒋嵵緔 提交于 2019-12-12 05:54:35

问题


I can't set a breakpoint in JavaScript files in my MVC projects in Visual Studio Community 2015 Update 3. I get this error at bottom left of Visual Studio.

A breakpoint could not be inserted at this location

I can set breakpoints in C# files, but not JavaScript files.

Here is what I've done so far to troubleshoot:

  • checked web.config includes: compilation debug="true"
  • solution configuation set to "Debug"
  • browser is Internet Explorer
  • added BundleTable.EnableOptimizations = false; to BundleConfig.cs
  • tried adding breakpoints in both generated files during debugging as well as source code JS files when not running
  • Rebuilt project, restarted Visual Studio
  • Repaired Visual Studio
  • Created new projects with both .Net Framework 4.5.2 and 4.6.1
  • also tried all suggestions listed in this post Breakpoint Failed to Bind - Visual Studio 2015

回答1:


You really can't debug a javascript code on vs2015 and below but on vs2017 its already possible. Just make sure to Enable JavaScript debugging for ASP.NET by going to Debug>Debugging>General menu.




回答2:


Set 'Configuration Manager' => Debug



来源:https://stackoverflow.com/questions/41974629/a-breakpoint-could-not-be-inserted-at-this-location-vs-2015-only-javascript-fi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!