I run two applications, Tradestation and Ninjatrader. Ninjatrader provides a managed .Net dll to allow other applications to communicate with it. We built a second dll to allow Tradestation to use the Ninjatrader dll. Using the dll on a Win 11 desktop with the Ninjatrader version 8.0.27 and lower, it works as intended. Using the dll on Windows server 2019, the dll works as expected with Ninjatrader 8.0.28. However, on a Windows 11 desktop, it return C++ exception trying to use it with Ninjatrader version 8.0.28. Can someone give me a hint on where to look for the problem?
did you eliminate the obvious things like permissions (run as admin to test it) or folder paths (trying to reach illegal path due to windows changing system paths sometimes) etc?
have you searched the problem online? I did very briefly and windows updates caused havoc a few months back, so make sure the machine is fully up to date.
anything more in the windows crash logs etc?
is the dll in the path that the using program can get to it?
basic stuff, but all easy to overlook.
Here is the setup. This was working on my desktop at first, but no longer does. It still works on the server. If I copy the dll from the server to my desktop, then it still does not work. The dll that is on the server was created on my desktop a few days ago. All I know is what the Tradestation app reports, which is C++ exception. I recently updatd Windows on my desktop, but only because the dll had stopped working by then. I have the VS project that was given to me by the developer, so I can recreate the dll. Both DLL's are in the Tradestation program folder which is "C:\Program Files (x86)\TradeStation 10.0\Program". Tradestation is 32 bit, Ninjatrader is 64 bit. Another weird thing is that when it was working on my desktop, it quit working when I updated Ninjatrder to a later version, but when I roll back Ninjatrader to the version that it was working with, it still does not work. I do not understand much about dependencies or figuring out if that is the problem. https://imgur.com/a/12LFOYQ
Further information: On another Win 11 computer I have three versions of the dll, all created using the same VS project, and they all work. I have three Win 11 machines. On two of them, the dll does not work, They are OS build 22621.1848 and 22621.1928. The OS build on the machine that is working is 22621.1778. Does this suggest that it is a Windows issue?
Still the most important question remains: What exact exception do you get, and where?
Do you get an exception in "Tradestation" when trying to call the C++ DLL, or do you get an exception inside your C++ DLL when trying to call the managed DLL, or is the exception thrown inside the managed DLL ???
My situation has been partially resolved by running regasm for the dll of interest, meaning this:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Client.dll" /codebase
And while this got one of my computers to work with the wrapper dll, on another Windows 11 computer, it fails.
Each machine if running the same version of the apps I'm working with.
Why would this be hit and miss?
The developer I'm working with has created a stand alone app for testing the Ninjatrader.dll. I can run it from a command window and tests the ability to use the Ninjatrader dll (NinjaTrader.Client.dll). It works sometimes.