Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to hit breakpoints while debugging in visual studio

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

    Unable to hit breakpoints while debugging in visual studio

    Hello there,

    I am trying to learn how to debug my strategies...however I am getting the message. The source code is different from the original version. Below is a screenshot;Click image for larger version

Name:	image.png
Views:	90
Size:	64.2 KB
ID:	1337130
    I have tried recompiling (from within ninjascript editor window), closing visual studio, restarting everything....to no avail...

    I have followed both this guide below from ninjatrader docs, plus a random youtube I found...
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.



    I am attaching to this executable;
    Click image for larger version

Name:	image.png
Views:	68
Size:	114.6 KB
ID:	1337131


    I've got debug mode turned on
    Click image for larger version

Name:	image.png
Views:	71
Size:	47.0 KB
ID:	1337132


    No luck. Does anyone have any ideas?

    Thanks heaps for any help

    #2
    Hello HungryGhost,

    Thank you for your post.

    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, 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 me know if I may be of any further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X