Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error when referencing dll

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

    Error when referencing dll

    I am trying to use TensorFlow within NinjaScript. I went into Visual Studio, downloaded a package for it, and grabbed the .dll file, placing it into the \Documents\NinjaTrader 8\bin\Custom folder. However, I am getting the error "Metadata file 'filepath\tensorflow.dll' could not be opened. An attempt was made to load a program with an incorrect format" The library's dependencies are .NETStandard Version = 2.0 so they should work on Ninjascript. I have already made sure that Ninjascript is using .NET 4.8 and that it is running using the 64 bit architecture. I am able to use the library within a Visual Studio Project, but within Ninjascript it does not work.

    #2
    Hello Ceraphen,

    You would need to locate a .net framework assembly, .netstandard is a different framework and not used by NinjaTrader. The assembly needs to be made for .net framework C# version 4.8 or less.

    Comment


      #3
      Hi Jesse,

      I tried again with a library that needs a .net framework v4.6.1 assembly but I am still not able to get it to work.
      Click image for larger version

Name:	image.png
Views:	133
Size:	24.4 KB
ID:	1268417

      Comment


        #4
        Hello Ceraphen,

        The image you provided mentions xamarin which is an android framework. That likely is not the correct version. You could also be missing other references or resources, you need to copy all dlls and other files the library requires from the bin/debug folder. You also need to reference other C# dlls that the library may have in the visual studio references. The easiest way to do this is to use the addon sample from the help guide, you can delete the addon sample dll after doing the following steps.
        1. Visit https://ninjatrader.com/support/help...t_overview.htm
        2. Go to the section AddOn Development Environment (Visual Studio Advanced) and download the visual studio project.
        3. Open the project
        4. Add the library you want using nuget
        5. Build the project (ninjatrader may need to be closed if you used this sample before)
        6. Look in the projects bin/debug folder and copy all of the .dll files and other content like .xml or any resource that library may use to the bin/custom folder.
        7. Reference all C# dlls that you copied using the NinjaScript editor.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        607 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        353 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X