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

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.
    JesseNinjaTrader Customer Service

    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:	83
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.

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by 00nevest, Today, 02:27 PM
        1 response
        8 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        8 views
        0 likes
        Last Post port119
        by port119
         
        Started by Philippe56140, Today, 02:35 PM
        0 responses
        7 views
        0 likes
        Last Post Philippe56140  
        Working...
        X