Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

New Install trying to debug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New Install trying to debug

    I just got a new pc and installed Ninja and copied my custom folder and all of my code including indicators and strategies to the new computer. i was able to get it to compile in Editor and also the indicators are loading.

    However, when i try to attach to process like I do on my old computer, and place a breakpoint to see where the code is failing on a problem, I am getting a message stating

    The breakpoint will not be hit, no symbols have been loaded for this document

    I never had this issue on my old pc which used an older version of Visual studio.

    Can anyone help me out with this?

    #2
    Hello ErikY,

    Thank you for your post.

    Since this is a new PC and new install, please be sure you are following each step outlined here:


    More specifically, you must right-click the NinjaScript Editor and check the option for Debug Mode, then compile with F5 before launching the NinjaTrader.Custom project in Visual Studio. At this time, Visual Studio 2019 and 2022 are supported versions for using the Visual Studio icon in the NinjaScript Editor toolbar.

    Once debug mode has been enabled and the NinjaScript files have been compiled to generate the debug DLL, you should follow the Attach to Process steps on that page and then you should be able to create breakpoints successfully.

    Please let me know if you are still receiving the same message, and if so please provide a screenshot so I may better understand and assist you.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    ​Thank you for using NinjaTrader.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      ok, thanks, so now I have a different message, its now saying breakpoint will not be hit becuase source code is different than the original, I saved and rebuilt the project and than compiled in editor, which is what I have always done, and this usually would go away on my old computer, but its not going away on this one
      Attached Files

      Comment


        #4
        Originally posted by ErikY View Post
        ok, thanks, so now I have a different message, its now saying breakpoint will not be hit becuase source code is different than the original, I saved and rebuilt the project and than compiled in editor, which is what I have always done, and this usually would go away on my old computer, but its not going away on this one
        This error can appear with breakpoints in Visual Studio when attaching the debugging if your source file has changed and the source no longer matches the code you're debugging.

        During compilation, the open-source code is compiled into NinjaTrader’s assembly source. The code that runs within NinjaTrader coming from the internal source is different than the open source script you are editing which is kept separate and exposed.

        To resolve this, follow one of the options to disable these safety checks:
        • To modify a single breakpoint, hover over the breakpoint icon in the editor and select the settings (gear) icon. A peek window is added to the editor. At the top of the peek window, there's a hyperlink that indicates the location of the breakpoint. Select the hyperlink to allow modification of the breakpoint location and check Allow the source code to be different from the original.
        • To modify this setting for all breakpoints, go to Debug > Options and Settings. On the Debugging/General page, clear the Require source files that exactly match the original version option. Make sure to reenable this option when you're finished debugging.


        These instructions come from the Microsoft documentation on Troubleshooting Breakpoints in the Visual Studio Debugger:

        Microsoft documentation: Learn > Troubleshoot > Visual Studio > Troubleshoot breakpoints in the debugger

        Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Thanks Emily, and I did find those work arounds, but on my original pc, I never had to do these workarounds, in fact, the setting for require source files is actually always checked on that version of visual studio and on that machine and I never have a problem, so I was unsure why this is happening on the new pc with the new version

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          2 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          1 view
          0 likes
          Last Post 00nevest  
          Started by Jonafare, 12-06-2012, 03:48 PM
          5 responses
          3,986 views
          0 likes
          Last Post rene69851  
          Started by Fitspressorest, Today, 01:38 PM
          0 responses
          2 views
          0 likes
          Last Post Fitspressorest  
          Started by Jonker, Today, 01:19 PM
          0 responses
          2 views
          0 likes
          Last Post Jonker
          by Jonker
           
          Working...
          X