locked
The breakpoint is not hit while debug of a windows javascript metro app referencing windows runtime component in C#

    Question

  • I've changed the debug type from "script only" to "managed only" in the startup project. But I attached the debug to the javascript app, the breakpoint in the referenced WinRT component was not hit anyway.

    Can anyone help me on that? Thank you in advance.

    Wednesday, January 30, 2013 10:49 AM

Answers

  • ha, acturally I found out the solution that the project needs to be added into the solution along with the javascript metro app project.

    • Marked as answer by Chong Feng Thursday, January 31, 2013 3:26 AM
    Thursday, January 31, 2013 3:25 AM

All replies

  • ha, acturally I found out the solution that the project needs to be added into the solution along with the javascript metro app project.

    • Marked as answer by Chong Feng Thursday, January 31, 2013 3:26 AM
    Thursday, January 31, 2013 3:25 AM
  • Hi Chong.Feng,

    As described in Chapter 16 of Programming Windows 8 Apps in HTML, CSS, and JavaScript, Visual Studio can only debug one type of code at a time. Here’s the relevant excerpt:

    When you hit that [JavaScript] breakpoint, step through the code using Visual Studio’s Step Into feature (F11 or Debug > Step Into). Notice that you do not step into the C# code, an effect of the fact that Visual Studio can debug either script or managed (C#)/native (C++) code in one debugging session but unfortunately not both. Clearly, using some console output will be your friend with such a limitation.

    so the breakpoint on javascript code can only work when you choose 'script only'.

    Hope this helps, thanks.


    Yanping Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 31, 2013 3:42 AM
    Moderator
  • Hi Yanping,

    The breakpoint was set in the component project in C#, so the debug type is well configured as 'managed only'.

    Anyway, the problem is solved. Thank you for your reply.

    Chong

    Thursday, January 31, 2013 4:06 AM