Home Dashboard Directory Help
Search

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


Status: 

Active


47
0
Sign in
to vote
Type: Bug
ID: 807088
Opened: 10/30/2013 1:56:14 PM
Access Restriction: Public
1
Workaround(s)
view
29
User(s) can reproduce this bug

Description

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."
Details
Sign in to post a comment.
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 Weeder 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
Peter,

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

Thanks,
Pam
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).

Regards,

Peter
Posted by Microsoft on 10/31/2013 at 2:43 AM
Hi PDQ,

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)
Sign in to post a workaround.
Posted by Forest Gower on 1/30/2014 at 10:16 PM
Insert the keyword "debugger" within the javascript before the line which you want to set a breakpoint.
File Name Submitted By Submitted On File Size  
Screenshot.gif 10/30/2013 60 KB
ProjectProperties2.png 12/1/2013 36 KB