Unable to debug javascript from the VS 2013 IDE -- unable to set breakpoint - by PDQ

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 807088 Comments
Status Closed Workarounds
Type Bug Repros 37
Opened 10/30/2013 1:56:14 PM
Access Restriction Public


After my upgrade to VS 2013, I am no longer able to debug javascript within MVC razor files. 

Previously with 2012, I was debug using the following steps:
- Launch MVC web app from IDE
- Navigate to desired webpage
- From within IDE, double-click the page within the Script Documents (the "[dynamic]" page content window opens)
- scroll to desired javascript, set breakpoints, etc.

Now, when following the same steps, the an IDE status/error message appears in the lower-left indicating that "A breakpoint could not be inserted at this location."
Sign in to post a comment.
Posted by CubiGear on 4/15/2015 at 5:29 AM
Pity, this is annoying having to write debugger; in the code to get a breakpoint hit for inline javascript in Razor. HELP !!!!!!
Posted by Ramon Barreda on 8/27/2014 at 8:39 AM
Hello All.
Still does not work for me.
I tried the workaround and suggestions here as well as many suggestions I found on the Internet.

VS2013 Professional with SP2
Windows 7 Enterprise.

Posted by Martin Staael on 6/14/2014 at 12:08 AM
If you have this issue then verify that you disabled optimizations

BundleTable.EnableOptimizations = false;

It seems not to want to debug if optimizations is on
Posted by PDQ on 5/14/2014 at 11:11 AM
Confirmed...Update 2 fixes this issue for me. Thanks...
Posted by mlaskie on 5/14/2014 at 10:47 AM
VS Update 2 works for me as well, thanks!
Posted by Jono Stewart on 5/13/2014 at 5:59 PM
VS 2013 Update 2 has worked for me. Can set breakpoints in both dynamic and non-dynamic (even if it STILL doesn't always pick up the break points set pre-runtime).
Posted by Mgbtech-mbeeler on 5/12/2014 at 8:39 PM
Installed update 2 rtm and no improvement with breakpoints in an mvc 4 razor project .net 4.5 ie11.
Posted by terryda on 5/7/2014 at 12:31 PM
I Installed VS2013 Ultimate Update 2 RC yesterday on a new machine coming from VS2010. I am mid-way through a large development and looked forward to the improvements in VS2013. Yet I can't debug JavaScript. It was simple enough in 2010. Should I just uninstall and fall back to 2010?
Posted by Microsoft on 5/5/2014 at 10:31 AM
This should be fixed in VS Update 2, please try that when it's released and do let us know if you are still seeing issues!
Posted by MirkoMaty on 3/17/2014 at 7:48 AM
Are there any new insights? I have the same behavior as described by J-S-B with razor code. Can't set a breakpoint in a helper method.
VS 2013 Update 1
ASP.NET Debugging enabled
Posted by ApollyonBoB on 2/9/2014 at 7:18 PM
As we've passed the 3 month mark of "We'll look into it" is there any movement on this? To be honest, this issue has been vexing me for awhile now. Even the aforementioned steps in 2012 aren't good. In 2010, you used to be able to just set the breakpoint before you ran the app. Then in 2012, that didn't seem to work very well. Oddly it seemed to work infrequently, versus not at all. You either had to wait for the app to start, then go back to VS and navigate around and find the dynamic pages, or put "debugger" everywhere.

Now in VS2013, JavaScript debugging is basically non-functional for me. I uninstalled everything I could - old versions of VS, anything that looked related to old versions of VS, and reinstalled VS2013 Ultimate. No joy. The only way I can get the code to stop now is inserting the text "debugger" which, in addition to being an annoying step, can't take advantage of features like conditional breakpoints. As a web developer, I feel like I should be able to do what I did back in 2010 - just click on the side of the window, during design time, prior to run, set the breakpoint, and have it get hit when I run the web app.

What I get instead is "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line." And when I open up the dynamic pages, I get just straight text for all the JavaScript. No syntax highlighting of any sort, and breakpoints cannot be inserted where you click.

I thought maybe it was just my install, but this is what I get on my main machine, my laptop, and my work machine.
Is there some tool I should be installing along side VS? Some powerpack or something that will make this work? Inserting "debugger" is not good enough for a work around, and I have a hard time imagining that the VS team just doesn't debug JavaScript.

Also, I occasionally see things like this: http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/28/javascript-native-interop-debugging-in-visual-studio-2013.aspx which give me the thrill of hope for a moment before reading down in the comments that, oh this is just for Windows Store C++ - C# web dev, this totally already works. Oh it doesn't? Email us.

Seriously can you guys stick a page somewhere on the Internet saying "If you are having this problem go here, do this, this is how you solve it" or something?
Posted by J-S-B on 1/29/2014 at 12:31 PM
It is 29 JAN 2014, and it appears this issue has not been resolved.
I am running VS2013 - Update 1 on a Windows 8.1 machine, along side a VS2012 on a Windows 7.
The VS2012 works, allowing me to put breakpoints into C# code in the cshtml files.

The VS2013, will let me put a breakpoint into the same cshtml file at any spot so long as it is NOT inside a @functions block.
For this, I set it at the 1st C#/CSHTML code this line: ==> Layout = null;
I can literally debug with VS2013, and get to the above breakpoint, and then step into the rest of the code.
It appears the @functions block is broken VS2013 for debugging-breakpoints.
I have tried moving the @functions to the top, it made no difference.
Posted by Eric3333 on 1/23/2014 at 6:44 AM
I just installed Update 1 for VS2013 and crossed my fingers, but no dice. This problem is persisting for me.
Posted by Chris_Cook on 1/9/2014 at 3:32 AM
I have the same issue. So annoying.
Posted by Richard Dutton on 1/6/2014 at 5:28 AM
Any updates on this? I am encountering the same issue.
Posted by PDQ on 12/2/2013 at 9:08 AM

In my C# project, the ASP.net debugger option is already enabled. I still cannot set a breakpoint in javascript.

Posted by WayPoint7 on 12/1/2013 at 4:24 AM
Perhaps the solution is this: enable the "ASP.NET" debugger in the project properties. I had the same experience and noticed that after upgrading to VS2013 this option was disabled. Enable it again and the breaks work again (in my case). See attachment (solution for VB.NET, I think in C# it is a bit different).


Posted by Microsoft on 10/31/2013 at 2:43 AM

Thanks for your feedback. Please ignore the last comment. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 10/30/2013 at 11:25 PM
Thanks for your feedback. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project so that we can conduct further research?

Please submit this information to us within 3 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 10/30/2013 at 2:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)