A breakpoint could not be inserted at this locatio

2019-09-07 00:42发布

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

2条回答
老娘就宠你
2楼-- · 2019-09-07 01:27

Set 'Configuration Manager' => Debug enter image description here

查看更多
神经病院院长
3楼-- · 2019-09-07 01:38

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.

查看更多
登录 后发表回答