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

Getting started with Visual Studio - compile errors not in my code

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

    Getting started with Visual Studio - compile errors not in my code

    I'm getting 2,122 compiler errors in NinjaTrader code after installing Visual Studio.

    It seems that when people first install VS, and try to compile NT C# code, there are a multitude of compiler errors, mostly due to:

    1. Duplicate attributes (CS0579)
    2. Definition conflicts within a namespace (CS0101)
    3. Definition conflicts with same parameter type (CS0111)
    4. Ambiguity between identical names (CS0229)

    All the errors seem to be caused by some kind of duplication, none of which is in my code. Most are from the ResourceDesigner.cs file, some from a .NET framework file.

    Are there resources or suggestions somewhere that help programmers correct these compiler errors?​

    #2
    Hello bsmith,

    Thanks for your post.

    Are you seeing the compile errors in the NinjaScript Editor window?

    Note that when debugging a script using Visual Studio, you would enable 'Debug mode' but right-clicking in the NinjaScript Editor window and clicking 'Debug mode'. A checkmark will appear next to the option when it is enabled. Then, click the Visual Studio button in the NinjaScript Editor toolbar to open Visual Studio. Changes would be made to the script in Visual Studio, you would save the changes, such as clicking Ctrl + S on your keyboard, and then click the 'Compile' button in the NinjaScript Editor window and note any compile errors that occur. Note that the script should not be compiled in Visual Studio, only the NinjaScript Editor window.

    See this help guide page for information about debugging with Visual Studio and note the Tip section at the bottom of the page: https://ninjatrader.com/support/help..._debugging.htm

    That said, please send me a screenshot of what you are seeing so I may investigate further.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    ​Thanks in advance; I look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,

      Thank you for the quick and informative response. I was mistakenly trying to compile in VS, which evidently resulted in my errors. Unfortunately I followed a youtuber's advice on how to get started, and one of the suggestions was to make a copy of NT files before starting VS. I made the copy, now NT thinks it needs the copy, and it won't compile without the copy (I haven't changed or moved the original files).

      How can I tell NT that it doesn't need these files - they are just my backup copy?

      Comment


        #4
        Hello bsmith,

        Thanks for that information.

        The 'Pre-Visual Studio backup' folder must be removed from the Documents\NinjaTrader 8\bin\Custom folder to resolve the compile errors.

        You could consider moving this folder to your Documents folder or Desktop folder in the File Explorer window. After removing the 'Pre-Visual Studio backup' folder from the Documents\NinjaTrader 8\bin\Custom folder, restart NinjaTrader and run a compile in the NinjaScript Editor window. Note if there are any compile errors remaining.

        If there are compile errors remaining and you do not know how to resolve them, please send me a screenshot of the compile errors left and I will be happy to provide further direction.

        Let me know if you have further questions.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geddyisodin, Today, 05:20 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        3 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by timko, Today, 06:45 AM
        2 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        4 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X