Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Visual Studio Debugging

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

    Visual Studio Debugging

    Visual Studio is a great way to debug NT scripts. All was working well until I opened "NinjaTrader.Custom.csproj" outside of NT8 (or updated to NT8 v8.1.2.1?).

    Now when I call Visual Studio from the NT8 (v8.1.2.1) Editor my breakpoints are disabled and I get "… the current source code is different from the original version" but the source code is the same as the NT8 script?

    I can work around this is Visual Studio "go to Debug > Options and Settings. On the Debugging/General page, clear the Require source files that exactly match the original version option".

    but wondered if anyone could offer any help?


    Last edited by fingers; 12-04-2023, 05:00 AM.

    #2
    I think it may be something to do with source control, which may be off topic?

    but not sure ... NT8 new version or Visual Studio new version?
    Last edited by fingers; 12-04-2023, 07:11 AM.

    Comment


      #3
      Hello fingers,

      The open source scripts being edited are technically different that what is compiled into the NinjaTrader.Custom.dll.

      To resolve, follow one of the options to disable these safety checks:
      • 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.​
      • 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.
      These instructions come from the Microsoft documentation on Troubleshooting Breakpoints in the Visual Studio Debugger:
      If a breakpoint is disabled or couldn't be set, it's displayed as a hollow circle. Look here information on problems that can occur when setting breakpoints.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        ok thanks, this appears to be a new issue I didn't have before?

        Comment


          #5
          Hello fingers,

          This change may have been with NinjaTrader 8.1.7. I am working with our development team to find out more information about what changed.
          Once I have more information I will let you know what I have found.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I would suspect that possibly VS is detecting when the boilerplate code is added to the end of the indicators at recompilation - the code that supports instance caching and allows their plots to be accessed from strategies. Possibly, with the change in C# version, there is some technical nuance in how this detection is done, and VS thinks it has changed because of the steps along the way or the file timestamps, even if in reality it's compiled down to the same byte code as previously.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            597 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            343 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            556 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            555 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X