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, 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 NeverDownMoney, Yesterday, 04:21 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by wjadevries, Today, 12:58 AM
        0 responses
        7 views
        0 likes
        Last Post wjadevries  
        Started by JoeyBoy, Yesterday, 04:05 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by bruhnrp, Yesterday, 05:56 PM
        2 responses
        15 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by NtFan, 04-10-2020, 04:05 PM
        5 responses
        58 views
        0 likes
        Last Post jeronymite  
        Working...
        X