2

I enabled Just My Code in Visual Studio 2013 but I cannot hit a breakpoint in my javascript code let alone not stepping into an external javascript library e.g. jQuery. I can hit using debugger keyword and unchecking disabling script debugging from Internet Explorer though. I think MS has introduced such a great feature but it is useless if I cannot use it with ASP.NET.
Someone please suggest anything.

3 Answers 3

3

You need to read the documentation in this URL. It tells you all about how VS determines if the code is your code or not, and how to tell VS what is your code and not. Be sure to skip down to the JS section.

http://msdn.microsoft.com/en-us/library/dn457346.aspx#BKMK_JavaScript_Just_My_Code

Sign up to request clarification or add additional context in comments.

4 Comments

Ok. I will look into it. But how to hit a breakpoint in my JS code?
Well you first need to make sure that VS knows that the script you are wanting to break in is considered "Just My Code." So read the link provided and configure your project with the needed edits to make that happen. After that just set a breakpoint in your code, or call the debugger statement.
Also a quick note, as of this writing there is a bug in VS JMC that treats all script blocks in html pages to be not "Just My Code", so they will not break. If you move the JS out to a .js file and reference it in your page it should break. I spoke with the VS JMC team and it should be fixed with the next update.
Very generous of you to share this info with us.
0

You can use Firefox and use Firebug plugin to debug your javascript.

Also check Just My Code for JavaScript Windows Store Apps in Visual Studio 2013

3 Comments

Thanks. I had a look at Firebug and I liked it. But I wanted to use VS2013's debugging features if I could. Is it only limited to Windows Store Apps?
Does FireBug have Just My Code?
@RichieHindle I just tested and it seems like it does not have any feature like Just My Code.
0

The inconsistency of JS breaking in VS is a pain. If I am in a hurry I simply insert an errorable statement (eg., sdfasdf;) at the spot in the JS where I want to look at the variables. This causes an alert window to pop up. Click the 'Break' button and you will be at the line that caused the error. At that point all of your variables will be visible. You can then drag the yellow current line indicator to a line of your choosing and continue processing from there. This has worked for me since VS 2005.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.