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

Loading indicator causes ReflectionTypeLoadException

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

    Loading indicator causes ReflectionTypeLoadException

    I tried to program an indicator which is using the NServiceBus open source service bus for net. So basically I added the using NServiceBus statement and the references to NServiceBus.dll, NServiceBus.Core.dll. In the code I'm referencing the IMessage class of NServiceBus. The indicator compiles without an error.
    Now, if I try to add the indicator to a chart an error message with a ReflectionTypeLoadException pops up (see attachment). The thing gets even worse if I close NT and try to restart it - NT is not even able to start.
    Looks like a weird bug in NinjaTrader, while compiling the indicator everything works fine, as soon I try to use the indicator NT is missing the IMessage declaration from the NServiceBus.dll, NServiceBus.Core.dll. I also tried to copy both dll into the NT custom folder without luck.

    Just interesting in a workaround for this NT bug.
    Thanks
    Attached Files

    #2
    Welcome to our forums Frank - were those .NET dlls compiled with a 3.5 target framework selected?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hey Bertrand, danke fuer die schnelle Antwort.
      So basically I got the latest 3.2.6 version of NServiceBus (http://nservicebus.com/Downloads.aspx). I assume that it they were compiled with the 4.0 Framework.
      Do you think that this is the issue? I'm just wondering why the compiler does not complain. But as soon I try to open the dialog to add an indicator to the chart the exception pops up. I'm not even selected this specific indicator. I just opened the dialog. So it looks like that in this case NT is somehow scanning all the indicators again for errors. The same happens if I open NT - the startup breaks and Windows is showing the error message that the program failed to start. If I'm removing my indicator from the Custom/Indicator folder NT is able to start without an issue.

      It seems to me that this is a general issue in NT - the different behavior within the programm, the compiler runs fine, but later everything breaks.
      Does NT always require DLL's compiled with the 4.0 Framework?

      Danke
      Frank

      Comment


        #4
        Hallo Frank - yes very likely that's the issue you run into then - NT7 would require referenced DLl's to be compiled using nothing later then target framework 3.5. We have an update to higher version on our list of feedback in product management and I've just added a vote here on your behalf in as well.

        The references added are global, so I'm not surprised to the issue appearing as you open the dialog for the parameters up.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I found the 3.5 .NET version of the DLL's and it works. Thanks for explaining.
          But it would be nice to have this verification already at compile time - so basically the compiler should verify the referenced DLL's and should give a clear statement that there is a version conflict. The current behavior - NT does not come up - is frustrating if someone has no clue where it is coming from.

          But don't get me wrong, I still like NT, but also a great product can be improved.

          Comment


            #6
            Thanks for letting me know. I will add your feedback into our lists to make users better aware of this version compatibility.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Bertrand, faced a new problem yesterday.
              Error on calling 'OnStartUp' method for indicator 'tF_SMA': Could not load C:\Program Files (x86)\NinjaTrader 7\bin64\CliSecureRT.dll. Consider using 'Configure.With(AllAssemblies.Except("CliSecureRT. dll"))' to tell NServiceBus not to load this file.

              I'm using the .NET 3.5 version of NServiceBus. The indicator can be loaded, but as soon I'm calling the first NServiceBus method this messages can be seen in the output window.
              I also tried the
              Configure.With(AllAssemblies.Except("CliSecureRT.d ll") call, but then I get a Configure.With(AllAssemblies.Except("CliSecureRT64 .dll") error message.
              Appreciate any help, thanks.

              Comment


                #8
                Hi Frank, would unfortunately not have first hand experience using the NServiceBus with NT and it's not really in our supported scope here - do you get the same issue when working in NT7 32 bit?
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GLFX005, Today, 03:23 AM
                0 responses
                1 view
                0 likes
                Last Post GLFX005
                by GLFX005
                 
                Started by XXtrader, Yesterday, 11:30 PM
                2 responses
                11 views
                0 likes
                Last Post XXtrader  
                Started by Waxavi, Today, 02:10 AM
                0 responses
                6 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by TradeForge, Today, 02:09 AM
                0 responses
                14 views
                0 likes
                Last Post TradeForge  
                Started by Waxavi, Today, 02:00 AM
                0 responses
                3 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Working...
                X