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 mattbsea, Today, 05:44 PM
        0 responses
        4 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        31 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,282 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        20 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Working...
        X