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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,227 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        440 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        12 views
        0 likes
        Last Post FAQtrader  
        Working...
        X