• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Proper way to add 3rd party nuget package

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

    Proper way to add 3rd party nuget package

    What is the proper way to include a 3rd party nuget package to NinjaTrader.

    I tried to add the nuget package in the standard visual studio manner by adding it to the NinjaTrader visual studio solution and referencing it in my strategy C# code. The solution compiles from visual studio but not when I right click on the strategy in the NinjaScript Editor and select compile. I get an error message about the using directive for the nuget assembly.

    #2
    Hello dougservice,

    You would need the physical DLL because nuget is not used in NinjaTrader. Most frequently it is easiest to make a new visual studio project outside of NinjaTrader, add your nuget reference and build the project. Next, go look in the output folder and copy all the DLL's that are required for the nuget reference to the documents/NinjaTrader 8/bin/custom folder. Finally, use the NinjaScript editors Right Click -> References menu to reference the DLLs. Now when you compile, the visual studio project will be updated to include the reference so it matches NinjaTrader.

    If you do this in an external project, make sure you select the right .net version. For NT8 it would be .net 4.5 when creating a visual studio project. This is important so that nuget restores the correct dlls that NinjaTrader will end up using.

    Nuget relies on the visual studio project to restore the DLL's which is not going to work the same way that NInjaScript works. In this case, because the project is always being regenerated by NinjaTrader you would need to use the physical reference in NinjaTrader so that visual studio reflects what the platform actually has referenced.

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

    Comment


      #3
      Hello Jesse,

      The solution you describe works great and is easy to set up.

      Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by digibob, Today, 01:13 AM
      0 responses
      2 views
      0 likes
      Last Post digibob
      by digibob
       
      Started by kemoleena, Today, 12:31 AM
      0 responses
      5 views
      0 likes
      Last Post kemoleena  
      Started by aligator, 09-18-2019, 12:15 PM
      12 responses
      104 views
      0 likes
      Last Post Lancer
      by Lancer
       
      Started by StevenNelson, Yesterday, 05:45 PM
      0 responses
      7 views
      0 likes
      Last Post StevenNelson  
      Started by calebsandfort, Yesterday, 05:16 PM
      1 response
      7 views
      0 likes
      Last Post calebsandfort  
      Working...
      X