Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader Version 8.1.3.0 cannot debug anymore using visual studio

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

    NinjaTrader Version 8.1.3.0 cannot debug anymore using visual studio

    I downloaded the latest ninjatrader version.
    i clicked on the "visual studio icon" in the ninjatrader code editor to launch VS
    The VS launched is VS2022 Enterprise edition with version 17.7.4
    I added the EMA indicator on the chart
    I set a break point in @EMA.cs and followed the documented process to launch the debugger using the "attach process"
    For reasons unexplainable, the VS believes the source code loaded is different from original version.
    This is a new defect for the latest version as i have never seen this behaviour before.
    Click image for larger version

Name:	DSsCMu1.png
Views:	117
Size:	255.9 KB
ID:	1300383

    #2
    Hello junkone,

    Thanks for your post.

    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, 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
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      i never had this issue until 8.1.3.0

      ​and i am showcasing this as a issue that started with 8.1.3.0
      I specifically demonstraetd the issue with a NT indicator @EMA.cs so you can try to reproduce it yourself..
      Just to prove its a defect, here is a screenshot of the debugger on visual studio 2022 able to get into the breakpoints for @EMA.CS without any additional actions that i have to take

      Click image for larger version

Name:	QlfGHNP.png
Views:	85
Size:	506.6 KB
ID:	1300496

      Last edited by junkone; 04-21-2024, 08:49 PM.

      Comment


        #4
        Originally posted by junkone View Post
        i never had this issue until 8.1.3.0
        Could this possibly be your culprit!





        Please Be Save in this Crazy World!​
        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          I dont get a crash. and i am debugging @EMA.cs which is a ninja trader supplied indicator. so the posted article is not relevant

          Comment


            #6
            Hello junkone,

            Thanks for your notes.

            As stated in post # 2, 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.

            One of the steps mentioned below and in post # 2 would need to be taken to resolve the Visual Studio breakpoint error as noted on the Microsoft documentation.
            • 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.

            Microsoft documentation: Learn > Troubleshoot > Visual Studio > Troubleshoot breakpoints in the debugger
            ​​
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              why is this behaviour different between Ninjatrader 8.0.27.1 vs 8.1.3.0​.
              Why is the source code changing and different from original when using

              your own documentation makes no reference to this change in process.
              https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?visual_studio_debugg ing.htm

              Here is a recording of the debugging as you have indicated and there is a new popup(minute 1) that states that the source code has changed with a question!!!



              Finally, i am a above average skilled programmer with decent skills in debugging. I know this has changed and if you tried to compare debugging between these 2, you will see how "annoying it is.

              I still believe that its a defect caused by 8.1.3.0​ compilation process and is very very annoying. Just imagine if i have multiple files that are on the debugger, i would be having multiple popups.
              Last edited by junkone; 04-22-2024, 10:02 AM.

              Comment


                #8
                Hello junkone,

                Thanks for your notes.

                This behavior occurs because NinjaTrader updated the compiler to Roslyn in NinjaTrader 8.1.2.0 to allow for C# 8 to be used. This means the behavior would occur when using NinjaTrader 8.1.2.0, 8.1.2.1, or 8.1.3.0.

                There are no workarounds at this time to prevent that behavior from occurring.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  i disabled this flag from visual studio and dont see the popups anymore
                  Attached Files

                  Comment


                    #10
                    Originally posted by NinjaTrader_BrandonH View Post
                    As stated in post # 2, 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.​​
                    NinjaTrader_BrandonH This is rather confusing. It sounds like you are saying that, at one and the same time, the open source code that is compiled into the distributed NinjaTrader is both the same and different from the visible open source provided in the NinjaTrader distribution.

                    Can you clarify, please?

                    Thanks.
                    Multi-Dimensional Managed Trading
                    jeronymite
                    NinjaTrader Ecosystem Vendor - Mizpah Software

                    Comment


                      #11
                      Hello jeronymite,

                      Thanks for your notes.

                      The open-source scripts you are editing are kept separate and exposed from the NinjaTrader.Custom.dll which is why the breakpoint message occurs.

                      We do not have information as to why the Roslyn compiler is different in this regard so we cannot provide any further insight into the internal design of the platform.

                      Brandon H.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by KeitDevs, Today, 06:36 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post KeitDevs  
                      Started by AgriTrdr, Yesterday, 01:51 PM
                      6 responses
                      21 views
                      0 likes
                      Last Post bobperez  
                      Started by ETFVoyageur, Yesterday, 12:11 PM
                      11 responses
                      40 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by rdlans, Today, 05:42 AM
                      0 responses
                      7 views
                      0 likes
                      Last Post rdlans
                      by rdlans
                       
                      Started by llanqui, 05-22-2024, 06:14 AM
                      13 responses
                      35 views
                      0 likes
                      Last Post llanqui
                      by llanqui
                       
                      Working...
                      X