Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to use Newtonsoft Json but get netstandard reference error

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

    Trying to use Newtonsoft Json but get netstandard reference error

    I have a visual studio .Net Framework class library that is symlinked to the indicators directory. I do my compiling in Ninja. Project was working well until I tried to add Newtonsoft.Json.dll from C:\Program Files\NinjaTrader 8\bin.

    Procedure is to add the dll as a reference to class library in visual studio. Then add it as a reference in ninjascript editor. Then compile.

    This only happens when adding Newtonsoft.Json code. If I remove the code and the import then it compiles again.
    ExiaClient.cs The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. CS0012 114 13
    Last edited by bartrader; 04-16-2023, 04:52 PM.

    #2
    Hello bartrader,

    Thanks for your post.

    Using third-party resources such as Newtonsoft in NInjaScript would be outside of what our support could assist with or provide samples of. This is something you will need to diagnose and work through on your end. You can use third-party references in your own programming but this is something you would need to reference in the NinjaScript editor for it to work.

    Have you at this point referenced this DLL in the NinjaScript editor? Dropping the file in the bin/custom folder would only be part of being able to use that DLL. You also need to reference the dll using the NinjaScript editor -> Right Click -> References menu.

    Additionally, if you plan to export the item later, you would need to add the DLL to your export. https://ninjatrader.com/support/help...esOrNativeDlls

    See this forum thread for more information: https://forum.ninjatrader.com/forum/...1037318​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Ok so how can I parse JSON data using nothing other that whats included? Surely something so basic must be possible.

      Comment


        #4
        Hello bartrader,

        Thanks for your note.

        From the compile error in your initial post, it seems that you are using the wrong version of Newtonsoft that was built for NetStandard which is not supported in NinjaScript.

        Third-party dlls need to be built for the .NET 4.8 Framework or less. NetStandard, NetCore, and versions of .NET Framework newer than 4.8 are not supported frameworks for references.

        You may consider referencing the Newtonsoft.Json.dll file located in the C:\Program Files\NinjaTrader 8\bin folder.

        Note that there was an issue with referencing Newtonsoft in a previous version of NinjaTrader 8.1. If you are not updated to NinjaTrader 8 version 8.1.1.3, please do so using the steps below. Updates to NinjaTrader will contain the latest security updates and bug fixes, as well as occasional new features and instruments.

        To update NinjaTrader
        • Shutdown all programs including NinjaTrader *important
        • Download NinjaTrader from the link below
        • Double-click the downloaded file to execute it
        • Follow the on-screen instructions
        • Restart NinjaTrader
        You can read about changes to this release in the release notes linked below.

        https://ninjatrader.com/support/help...ease_notes.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X