Problem sovled.
Here’s my write up from Codex (desktop app)
Problem
I was trying to reference Parquet.dll from NinjaTrader 8 and kept getting this compile error:
CS0012: The type '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'.
I also got this startup popup:
Unable to retrieve type info for 'NinjaTrader.NinjaScript.AddOnBase'
from assembly 'Parquet': Unable to load one or more of the requested types.
Retrieve the LoaderExceptions property for more information.
Cause
The issue was not actually AddOnBase.
Parquet.dll was built against .NET Standard 2.0, and NinjaTrader 8’s NinjaScript compiler did not automatically reference netstandard.dll. Also, some of Parquet’s dependency DLLs were not in the folder where NinjaTrader expects third-party assemblies.
NinjaTrader was able to find Parquet.dll, but it could not fully load/compile against it.
Final Working Fix
-
Close NinjaTrader completely.
-
Put Parquet.dll and all of its dependency DLLs in:
C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom
In my case, I copied all DLLs from my third-party folder into bin\Custom, including:
Parquet.dll
Microsoft.Data.Analysis.dll
Microsoft.Bcl.AsyncInterfaces.dll
Microsoft.IO.RecyclableMemoryStream.dll
System.Buffers.dll
System.Memory.dll
System.Numerics.Vectors.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Text.Encodings.Web.dll
System.Text.Json.dll
System.Threading.Tasks.Extensions.dll
System.ValueTuple.dll
System.Collections.Immutable.dll
Apache.Arrow.dll
Snappier.dll
ZstdSharp.dll
IronCompress.dll
nironcompress.dll
Microsoft.ML.DataView.dll
- Copy the .NET Framework 4.8 facade
netstandard.dll from:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\netstandard.dll
to:
C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom\netstandard.dll
- In NinjaTrader’s References window, remove any old reference pointing somewhere else, for example:
C:\Users\<YourUser>\Documents\NinjaTrader 8\thirdparty\Parquet.dll
- Add the correct references from
bin\Custom:
C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom\Parquet.dll
C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom\netstandard.dll
- If NinjaTrader keeps removing the
netstandard.dll reference, manually add it to:
C:\Users\<YourUser>\Documents\NinjaTrader 8\Config.xml
Inside the <References> section, add:
<string>*MyDocuments*\NinjaTrader 8\bin\Custom\netstandard.dll</string>
Mine ended up looking like this:
<string>*MyDocuments*\NinjaTrader 8\bin\Custom\Parquet.dll</string>
<string>*MyDocuments*\NinjaTrader 8\bin\Custom\netstandard.dll</string>
- Also confirm that
NinjaTrader.Custom.csproj contains:
<Reference Include="Parquet">
<HintPath>C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom\Parquet.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>C:\Users\<YourUser>\Documents\NinjaTrader 8\bin\Custom\netstandard.dll</HintPath>
</Reference>
- Delete the NinjaTrader cache folder if the startup popup persists:
C:\Users\<YourUser>\Documents\NinjaTrader 8\cache
- Restart NinjaTrader and compile again.
Important Notes
The key fix was adding netstandard.dll as an actual NinjaTrader reference, not just copying it onto the machine.
Also, NinjaTrader may regenerate NinjaTrader.Custom.csproj from Config.xml, so adding the reference only to the .csproj may not persist. Adding it to Config.xml was what made the fix stick.
Caveat
NinjaTrader support generally recommends third-party DLLs be built directly for .NET Framework 4.8 or lower. A .NET Standard DLL can cause extra dependency/reference problems like this. The cleaner long-term solution is to use a .NET Framework 4.8 build of the library if available.
Hope this helps.