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

Indicator with custom DLL: cannot load library

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

    Indicator with custom DLL: cannot load library

    Hello
    I've got the following problem.
    Trying to create indicator which uses (references) my external DLL. This dll contains only empty class - no methods, no references to any other DLLs in the project. The DLL is compiled for .NET 4.5.0. Indicator's code contains the field of my class from dll. In OnStateChange() method I'm trying to create the instance of my class.
    The problem occurs when I'm trying to add the indicator - when I'm opening the indicator's window the exception is raised in OnStateChange() method saying:

    Indicator 'DMFXCOTFinFutNetPositions': Error on calling 'OnStateChange' method: Could not load file or assembly 'DMFX.NinjaTrader8, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Tried to build with other .NET frameworks (3.5, 4), Debug or Release versions of Dll - no luck.

    I'm stuck and any help will be highly appreciated.
    Last edited by Globus000; 01-17-2020, 05:38 AM.

    #2
    Hello Globus000,

    Did you put the dll in the folder: Documents\NinjaTrader 8\bin\Custom and reference it from that location? If you referenced the DLL outside of that folder you will see this error, it is looking for the file to be inside that folder specifically.

    Is this a DLL which you exported from NinjaTrader or was this created using visual studio?


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

    Comment


      #3
      Hello Jesse,

      Yes, but the only difference is that I've put the DLL in my subfolder - e.g. bin\Custom\DMFX\. References are added/ Could this make the difference?

      Comment


        #4
        Ok, looks like this was the case - the DLL should be exactly into bin\Custom\ folder. In case if put into some sub-folder even with the references set properly the indicator will be built but won't be loaded with the error mentioned above.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by xiinteractive, 04-09-2024, 08:08 AM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by swestendorf, Today, 11:14 AM
        2 responses
        5 views
        0 likes
        Last Post NinjaTrader_Kimberly  
        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
        6 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by TheMarlin801, 10-13-2020, 01:40 AM
        21 responses
        3,918 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X