• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, 04: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 [email protected], Today, 10:54 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by wbennettjr, Today, 11:18 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Induna, Today, 05:38 AM
        2 responses
        6 views
        0 likes
        Last Post Induna
        by Induna
         
        Started by Alfred, Today, 10:20 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by emuns, Today, 10:34 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X