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

Debug in MS Visual Studio, No Symbols Available

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

    Debug in MS Visual Studio, No Symbols Available

    Hi everyone,
    Not too sure what I'm doing wrong here. I've been working on an Addon project in Visual Studio 2019. In the past, I've been able to debug (no problem) by compiling NT8 in debug mode and then 'Attach to Process' in VS. I'm not able to debug like this anymore because Visual Studio is telling me my 'breakpoint will not be hit because no symbols have been loaded'. I thought perhaps the custom dll file NT8 creates when you compile in debug mode got corrupted so I deleted it and re-compiled it in debug mode but still get the same error. Can I force Visual Studio (or NT8) to reload the symbols? How can I fix this?

    thanks

    Brennan

    #2
    Hello BrennanSalibrici,

    Thank you for your post.

    While you have likely done several of these things already, to allow us to find out exactly what is occurring, I would like to ask if you could watch the video linked below and go through the steps to set up Visual Studio to work with NinjaTrader in order? Please stop and report back as soon as a step does not work, and let us know which numbered step it was.

    Visual Studio Debugging - https://www.screencast.com/t/hOcyzGOW

    Additionally, do you see the PDB file in the Documents > NinjaTrader 8 > bin > Custom folder after you recompile with Debug Mode checked?

    Thanks in advance, I look forward to your reply.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon

      I failed on step 6. Here's a pic of the VS error I got.
      Click image for larger version

Name:	NT Error.jpg
Views:	858
Size:	85.6 KB
ID:	1117777

      Also, I do have a .pbd file

      Brennan
      Attached Files

      Comment


        #4
        Hello BrennanSalibrici,

        Thank you for that information.

        The message you are receiving is just a warning. It should not hurt anything. Microsoft is just trying to warn you when you state that your project is compatible with "Any CPU" but you have a dependency on a project or .dll assembly that is either x86 or x64.

        Please note that errors/warnings can be searched so you can find more information about them. I have found the following publicly available link below after searching the warning message you received - https://stackoverflow.com/questions/...ocessor-archit

        Are you using the VS button in the NinjaScript Editor to open Visual Studio?

        What version of Visual Studio are you using? (community, pro, or enterprise edition)

        Did you proceed to Step 7 (adding breakpoints) after seeing the warning? If so, please report your results.

        Thanks in advance, I look forward to your reply.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Gosh, total bone-head mistake!! I'm so used to a file showing up in the editor that when it was blank, I thought it didn't read it right. Oh well, maybe I'll get some more sleep tomorrow, . Anyhow, I was able to make it all the way through the steps to the end of the video and the breakpoints that we set up from the video were hit correctly.

          I'm working on an AddOn project so I'm not using the NinjaScriptEditor to open Visual Studio, I'm just opening vs and opening the solution/project file as usual. I'm using VS 2019, community version.

          I was a bit hesitant to follow through on looking up errors and trying stuff for fear of continuing to change the environment on my machine making this problem more difficult to track down. Anyhow, I did follow the link and made the suggested changes; I don't get that error anymore, but still any not able to 'load symbols' which also means my breakpoints in this particular addon project are not getting hit.

          Comment


            #6
            So I opened NT again after I made that change and my AddOn no longer showed up in the menu any more. Since that was the only thing I changed, I walked back that change and now things seems to be reset and functioning again. Not quite sure why that made a difference, but now the breakpoints in my AddOn project are getting hit correctly.

            For anyone else out there wrestling with this -
            My project is compiling and being built for a x64 platform. I re-built my AddOn targeting x86 (which is when NT no longer saw my AddOn in the menu) and then rebuilt again targeting x64 again and that seemed to fix it. Might not be the fix for everybody but it's probably something to try. Hopefully it continues to work and I'm not back in a half hour cause it didn't last!

            Brennan

            Comment


              #7
              I am having a similar problem getting breakpoints to hit in VS 2019.

              I went through the Visual Studio Debugging - https://www.screencast.com/t/hOcyzGOW video, and got all the way through the final step. Attach to process seems to connect, and I see the Visual Studio GUI picker widgets on the ninja windows, but no breakpoints are hit. Hovering over them brings up the tooltip with "No symbols have been loaded for this document".

              I've also gone to the Modules window in the debug menu and can see that the NinjaTrader.exe process is showing "Skipped loading symbols" in the Symbol Status column.
              After right clicking on that "skipped loading symbols" field and manually Loading symbols I haven't been able to locate the Ninjatrader.pdb file. It seems like it doesn't exist?

              Do I need to cause NinjaTrader to generate this file, or should it be within the directory structure somewhere already?


              Thanks

              Comment


                #8
                Ah I figured it out

                It was fixed by entering debug on the ninjascript editor window BEFORE compile. This is a small deviation from the walkthrough video, for what it's worth.

                Comment


                  #9
                  Easy to miss that one, I just did the same.

                  Make sure to enable 'Debug Mode' in the NT Script Editor.

                  Comment


                    #10
                    This video: https://www.screencast.com/t/hOcyzGOW​

                    Is done in Flash which has been retired. Is there a newer version somewhere?

                    Comment


                      #11
                      Originally posted by carnitron View Post
                      This video: https://www.screencast.com/t/hOcyzGOWâ

                      Is done in Flash which has been retired. Is there a newer version somewhere?
                      Hello carnitron,

                      Thank you for your note.

                      Other than the video Brandon previously included, we do have a step-by-step guide for how to set up Visual Studio Debugging in our help guide here:


                      I went ahead and made a new video that demonstrates these steps, which may be found at the following link:


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

                      Comment


                        #12
                        Ah, thank you! My NT8 setup got whacked by OneDrive last week (I have since finally figured out a permanent fix for this), so I found myself struggling to remember all the steps I went through to get breakpoints working the first time. I suspect the main culprit is simply forgetting to select "Debug Mode" in the editor window, which this video highlights, so this is great to have on hand.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by swestendorf, Today, 11:14 AM
                        2 responses
                        5 views
                        0 likes
                        Last Post NinjaTrader_Kimberly  
                        Started by xiinteractive, 04-09-2024, 08:08 AM
                        4 responses
                        13 views
                        0 likes
                        Last Post xiinteractive  
                        Started by Mupulen, Today, 11:26 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post Mupulen
                        by Mupulen
                         
                        Started by Sparkyboy, Today, 10:57 AM
                        1 response
                        5 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by TheMarlin801, 10-13-2020, 01:40 AM
                        21 responses
                        3,917 views
                        0 likes
                        Last Post Bidder
                        by Bidder
                         
                        Working...
                        X