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

Unable to load custom assembly: The given key was not present in the dictionary.

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

    Unable to load custom assembly: The given key was not present in the dictionary.

    Hi,

    I created a custom DLL in C#. I can use the classes in this DLL from a test bench program without problems.

    This is not a NT Addon, just a class library in C#.

    However when I add a reference for this DLL in NT8, I receive this error when I reference a member that exists in this DLL and try to compile it.

    Unable to load custom assembly: The given key was not present in the dictionary.
    Unable to retrieve type info for 'NinjaTrader.NinjaScript.AddOnBase' from assembly 'NinjaTrader.Custom': Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    #2
    Hello jmneto,

    Thank you for the question.

    DLL loading failures can generally happen if the DLL is in the wrong format, or if one of the resources that DLL uses is not present.

    In your test program, I would suggest to open the programs output folder (usually bin/debug) and check what is in the output folder. Is it only your DLL or are there other files in the folder?

    If there are more files than just the .dll, I would suggest trying to copy all of the files into the Documents\NinjaTrader 8\bin\Custom folder, and make sure your Reference points to this folder as well.

    If the dll is in the wrong format that may also be a case, depending on the language used and format of the dll this may cause loading problems. If this is a C# dll, please ensure it is set to anycpu and .net 4.5 during the build.

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

    Comment


      #3
      Hi Jesse,

      It's c# .Net 4.5 everything is according to book. Actually the problem disappeared. Not sure it was some Visual Studio vs NT confusion or something else. Anyways, hope it keeps working.


      FYI, my observations indicate that there was some confusion when I tried to add my code as an addon but then decided to move the dll call to an indicator.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      5 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X