No announcement yet.

Partner 728x90


Example NinjaTraderAddOnProject Error in VS 2017

  • Filter
  • Time
  • Show
Clear All
new posts

    Example NinjaTraderAddOnProject Error in VS 2017

    NinjaTrader 64-bit

    Downloaded the example NinjaTraderAddOnProject (

    Opened NinjaTraderAddOnProject.sln in Microsoft Visual Studio Professional 2017 Version 15.9.18+28307.960

    Selected AddOnPage.xaml

    Immediately generated an error in the Designer: Exception: Cannot create an instance of "NTTabPage_0".

    Click image for larger version  Name:	VS2017 Exception for NT8 AddOn.png Views:	0 Size:	88.8 KB ID:	1083480

    Advice gratefully received. Thanks.
    Last edited by jeronymite; 01-10-2020, 08:58 PM.

    Hi jeronymite, thanks for your note.

    NT uses many custom WPF controls that are not Designer supported. The xaml page must be manually edited and loaded with your LoadXAML method defined in your addon.

    Please let me know if I can assist any further.
    Last edited by NinjaTrader_ChrisL; 01-14-2020, 09:21 AM. Reason: spelling
    Chris L.NinjaTrader Customer Service


      Thanks, Chris.

      Can the example be enhanced to provide a fully working example, please? I can find no LoadXAML method in the example code, even though I can see some examples in the AddOn documentation.

      A fully working example will make it so very much easier to understand all the interactions and dependencies of the code, and encourage much wider development usage of the AddOn capability.

      Many thanks!


        Hi jeronymit, thanks for your reply.

        I attached a simplified example of an addon in NT. The LoadXAML method is a local method definition that returns a DependencyObject, that is what gets used to fill the page content. I will also submit a feature request to add full designer support to the addon solution for Visual Studio.

        Please let me know if I can assist any further.
        Attached Files
        Chris L.NinjaTrader Customer Service


          Thanks, Chris. Very much appreciate the feature request.

          I didn't see any attachment. Did I miss it?



            Hello jeronymite,

            The attachment that Chris mentioned is a .zip file in post #4, its named "AddonShell_NT8B13 (1).zip", are you unable to see that? If you can't see that for some reason you can find that file additionally posted here:

            If you instead meant the tracking ID for the request Chris will reply back with that once hes got it.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service


              Thanks, Jesse.

              I meant I couldn't find the actual attachment to Chris's post. I cannot find it in the other post you reference either.

              I wondered if it might be a browser issue, but I've tried several different browsers, and with addons disabled.

              It's not the first time I've been unable to see attachments. I noticed this some time ago after the migration to the updated forum software.

              Are there direct links to attachments?


              UPDATE: It seems attachments are not visible when the view of the thread is "Latest Activity". One has to switch to the "Posts" view, where the attachments are visible. ... I suggest this is not an intuitively obvious functional behaviour. Nonetheless, I now can see attachments. Thanks.
              Last edited by jeronymite; 01-17-2020, 02:22 AM. Reason: Updated Information


                Hi jeronymite, thanks for your patience,

                We are tracking your feature request as:


                Please check the release notes upon future updates to track added features:
                Chris L.NinjaTrader Customer Service


                  Many thanks, Chris!


                    Trying to use VS2017 to implement the VS example AddOn. I receive the attached popup error when trying to "Start". I realise I need to follow the popup instructions, but being a relative newbie to VS, I would appreciate the process being explained, and included in the relevant NT8 documentation.

                    Grateful for assistance to complete the setup of the provided AddOn code in VS2017. Thanks!


                      May I also request a complete code review of the sample AddOn examples (Basic and VS versions). Although very similar, the VS version contains code that seems much older than the Basic version and makes references to potential "future" functionality "after Beta 10". This particular observation occurs in line 694 of AddOnPage.xaml.cs in the VS version as follows:

                      //PropagateIntervalChange(args.BarsPeriod); THIS IS NOT AVAILABLE IN BETA 10, BUT WILL BE IN BETA 11. NEW VERSION WILL BE UPLOADED AT THAT TIME.
                      The Basic version also has significantly improved and safer code than the VS version in a variety of places.

                      Ideally, the AddOn examples, both Basic and VS, should be:
                      • Completely reviewed and updated to be fully consistent in code across the two
                      • Updated to take advantage of all the features and functionality of the latest version of NT8
                      • Enhanced with additional example code, e.g. selecting and creating/closing multiple different tabs, etc
                      • Enhanced with additional code robustness
                      • Available as equivalent XAML and C# code only versions
                      Also, the VS version should be:
                      • "Out-of-the-box" ready for VS compilation and Starting without additional VS actions to make that process happen seamlessly
                      • Fully Designer supported
                      I would love to create new and exciting NT8 AddOns. For now, I can use the Basic version, "cross-matched" against the VS version for comparison, to inform me of ways to do things, but it is not ideal or easy to work with, particularly from a Design perspective.

                      The improvements requested above would, I believe, lead to more uptake of AddOns being created, to the great benefit of individual users and the NT Community at large. The sooner this can happen, the better for all.

                      Many thanks!
                      Last edited by jeronymite; 03-08-2020, 04:24 PM.


                        Hi jeronymite, thanks for the follow up.

                        I will compare the two scripts and let you know of any changes that will be made.

                        Thanks in advance for your patience.
                        Chris L.NinjaTrader Customer Service


                        Latest Posts


                        Topics Statistics Last Post
                        Started by aelagha, Today, 10:38 AM
                        1 response
                        Last Post NinjaTrader_Jim  
                        Started by aaadetos, Today, 10:36 AM
                        1 response
                        Last Post NinjaTrader_ChristopherJ  
                        Started by ntdev, Today, 10:53 AM
                        0 responses
                        Last Post ntdev
                        by ntdev
                        Started by westofpluto, Today, 09:59 AM
                        1 response
                        Last Post NinjaTrader_BrandonH  
                        Started by Doctor JR, Today, 10:02 AM
                        1 response
                        Last Post NinjaTrader_Kate