Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Symbol (.PDB) File Not Loading

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

    Symbol (.PDB) File Not Loading

    I'm trying to debug my ninjascript in visual studio 2022. I followed the process here (https://ninjatrader.com/support/help..._debugging.htm) but the .pdb file is not being loaded when I attach to process. It seems that only the release version is available even though I compiled in "debug mode" in the ninjascript editor. I also tried to manually load the pdb file from C:\Users\...\Documents\NinjaTrader 8\bin\Custom\ where NinjaTrader.Custom.pdb is located, but visual studio still cannot load symbols. Please advise?​
    Attached Files

    #2
    Hello jflaggs,

    Thank you for your post.

    The PDB should generated after compiling with Debug Mode enabled prior to attaching the debugger. Are you making sure to hit 'Compile' after enabled Debug Mode? Did you attempt to build or run with Visual Studio?

    https://forum.ninjatrader.com/forum/...77#post1054877

    If so, and the behavior is still occuring, please try a platform repair:
    • Shut down NinjaTrader 8
    • Go to your computer's Control Panel > Programs & Features (Note: search for 'Control Panel' to find it within the Windows Start Menu. This will be a different window than the Settings page)
    • Left-click once on NinjaTrader 8 > select 'Repair' above the list of available programs
    • Restart the platform after it finishes repairing.


    After finishing the repair, compile with Debug Mode enabled and launch Visual Studio from the Visual Studio button in the NinjaScript Editor. Then attach the debugger.

    Please me know if you continue to experience the same.

    Comment


      #3
      I followed those steps. My steps after that were to open a new chart in NT8, place a breakpoint on the OnBarUpdate() method of my indicator in VS 2022, then add my indicator to the chart expecting my breakpoint to be hit immediately. At that point, I get the following message in VS 2022 and my breakpoint is not hit. After clicking "No" on the dialogue message, NT8 crashed and closed automatically.

      One thing to note is that in that process, VS 2022 attempted to debug the decompiled version of my source code, and complained that it is different from the original version. For example, my original code uses the "var" keyword, but decompiled version uses strongly typed variable declarations. It also looks like VS 2022 is looking in this tmp folder rather than in the bin\Cusom folder. Have you seen this issue before?

      Click image for larger version  Name:	Screenshot 2023-12-07 191638.png Views:	0 Size:	12.8 KB ID:	1281280
      Last edited by jflaggs; 12-07-2023, 09:33 PM.

      Comment


        #4
        Hello,

        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

        Please let me know if this does not resolve the error.

        Comment


          #5
          Hello,

          I am having the same issue. I'm using the latest release of NT and windows 11.

          My steps are to reproduce the behaviour are:
          1. Open NT Editor,
          2. Open Strategy source in NT Editor and make sure DEBUG MODE is checked ,
          3. Click visual studio button on NT Editor toolbar
          4. Open strategy source code in VS Solution Explorer at Ninjatrader.Custom\Strategies
          5. "Attach to process..." from VS to NT using visual studio Debug menu
          6. COMPILE strategy using NT Editor (at this point VS would get all the info necessary to Debug in prior releases)
          I also got the same message as jfflags complaining about the source code and dll being out of sync and asking me to click yes/no

          I can also confirm the steps provided by Ninjatrader_Gaby do work after clicking "yes"
          I set a breakpoint at the top of OnBarUpdate and processing stopped on the breakpoint.

          However, I would like to know what can be fixed so that it would all work like it did in prior releases​ ?

          Comment


            #6
            Originally posted by rayko View Post
            Hello,

            I am having the same issue. I'm using the latest release of NT and windows 11.

            My steps are to reproduce the behaviour are:
            1. Open NT Editor,
            2. Open Strategy source in NT Editor and make sure DEBUG MODE is checked ,
            3. Click visual studio button on NT Editor toolbar
            4. Open strategy source code in VS Solution Explorer at Ninjatrader.Custom\Strategies
            5. "Attach to process..." from VS to NT using visual studio Debug menu
            6. COMPILE strategy using NT Editor (at this point VS would get all the info necessary to Debug in prior releases)
            I also got the same message as jfflags complaining about the source code and dll being out of sync and asking me to click yes/no

            I can also confirm the steps provided by Ninjatrader_Gaby do work after clicking "yes"
            I set a breakpoint at the top of OnBarUpdate and processing stopped on the breakpoint.

            However, I would like to know what can be fixed so that it would all work like it did in prior releases​ ?
            Agreed. This solution means that you need to constantly change VS options when switching between NT and other VS projects.

            Comment


              #7
              Hello,

              Thank you for your feedback.

              We are currently looking into this with our Development Team.

              We apologize for any inconvenience and thank you for your patience.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              65 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              139 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X