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.
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!
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
NinjaTrader
Proper way to add 3rd party nuget package
Collapse
X
-
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.Tags: None
-
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
- Likes 4
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mgco4you, Today, 09:46 PM
|
1 response
3 views
0 likes
|
Last Post Today, 09:56 PM | ||
Started by wzgy0920, Today, 09:53 PM
|
0 responses
3 views
0 likes
|
Last Post
by wzgy0920
Today, 09:53 PM
|
||
Started by Rapine Heihei, Today, 08:19 PM
|
1 response
8 views
0 likes
|
Last Post Today, 08:30 PM | ||
Started by Rapine Heihei, Today, 08:25 PM
|
0 responses
6 views
0 likes
|
Last Post Today, 08:25 PM | ||
Started by f.saeidi, Today, 08:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 08:17 PM |
Comment