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
Calling DLL from strategy
Collapse
X
-
No problem Scott. I discovered this through trial and error. Unfortunately Ninja Trader doesn't mention this incompatibility issue anywhere. I'm sure there are a lot of 2010 users out there who are going to run into this sooner or later. Hopefully the support team knows about it now. It would be a good idea to mention it in the release notes.
Comment
-
brucieW, have you found any way around this? I still have VS2008 installed but with the exception of the compact framework, everything looks to be .NET 4.0.
I have other projects going on so I can't just roll back to an earlier .NET; yikes. I really want this stuff in a dll and not methods in NT itself.
Comment
-
What I did was create a control library (DLL) project that targeted .NET 3.5 which I call from Ninja Trader. This library calls a service that still uses .NET 4 code. There is no way around this (until they make a release that can handle .NET 4.0). You have to make sure that this 3.5 library does not indirectly reference any other .NET 4 libraries. A real pain.
Comment
-
still the problem
Hi,
I have still this problem after a lot of checks based on the previous messages.
I tryied with a dll containing a very simple class :
namespace ClassLibrary1
{
public class Class1
{
public static int foo()
{
return 123456;
}
}
}
And in my strategy :
protected override void OnStartUp()
{
Log("read:"+ ClassLibrary1.Class1.toto(), LogLevel.Error);
}
Compile : ok
Runtime : can't find dll ...
Any idea?
Thanks
Fab
Comment
-
Originally posted by brucieW View PostNT will only work with 3.5 libraries, have you checked the properties of the DLL?
So the procedure for the ones which will have this problem :
1 - develop your dll, en c#, .NET 3.5, 64 bits if you intend to use NT 64bits
2 - copy the dll into <home>/nt7/bin/custom
3 - in the code interface of the stratgy, right-click, select "add reference" and select <home>/nt7/bin/custom/mydll.dll you copied at step 2
4 - restart ninja
5 - use your dll into the code of the strat
6 - test, should work
Comment
-
Has anyone come up with a work around and/or solution for running .dll files that are built with .net 4.0?Last edited by d.allen101; 12-09-2011, 05:52 PM.
Comment
-
hey bruce, i was reading in one of your replies where you mentioned something about a "control library" you wrote that targeted .net 3.5 etc...how is that working out? can you give a little detail on that?
Comment
-
d.allen,
I believe bruicieW was writing/compiling the library using .NET 3.5. That would assume you have the source code for the .dll and some ability (such as Visual Studio) to specify targeting the compilation to .NET 3.5. It also would mean that the source code wasn't using .NET 4 specific features.
VT
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cre8able, Today, 01:35 PM
|
1 response
3 views
0 likes
|
Last Post Today, 01:46 PM | ||
Started by johnMoss, Yesterday, 12:19 PM
|
4 responses
22 views
0 likes
|
Last Post
by johnMoss
Today, 01:45 PM
|
||
Started by martin70, Today, 04:06 AM
|
6 responses
15 views
0 likes
|
Last Post
by martin70
Today, 01:22 PM
|
||
Started by morleyc, Today, 11:37 AM
|
3 responses
12 views
0 likes
|
Last Post Today, 01:17 PM | ||
Started by Uregon, Today, 12:55 PM
|
1 response
4 views
0 likes
|
Last Post Today, 01:16 PM |
Comment