If you receive that error please note that the literal error text is very likely not the real problem. The actual problem is that your NinjaTrader.Custom.dll or a DLL it depends on or a 3rd party DLL is missing specifically from this location: …\Documents\NinjaTrader 8\bin\Custom
The quickest way to solve would be to drop DLLs you suspect are required into that directory 1 by 1 and restart NT8. I also deleted the “NinjaTrader 8/Cache” and NinjaTrader.Custom.* each time before starting NT8 until is worked but that might not be strictly required.
Note that placing NT8 DLLs or system DLLs in that directory is not advised as NT8 apparently links those in anyway from their proper location. Those should be added by “Adding Reference” within the NT8 script editor and not moved from their original location(s). For instance I think AddOnBase actually resides in NinjaTrader.Core or NinjaTrader.Gui.dll so in theory it may be possible to copy those to the Ninja Trader 8/bin/Custom however when NT8 starts there will likely be numerous runtime errors because it will not be able to find other DLLs or XAML/BAML/etc that those NT8 or System DLLs refers to. Anyway, as said above, “AddOnBase” is not the real issue anyway, so to iterate there should be no need to play with NT dlls except for experimentation.
Also if you are stuck, consider downloading a tool called ILSpy (available as an App from Microsoft Store) that helped me tremendously. One can open up a DLL it see what DLLs it depends on and list the symbols it defines or references.
Another thing I ended up doing it create a separate project called “NinjaTrader.Custom.Ownable.csproj” that was a copy of NinjaTrader.Custom.csproj. The reason is that NT8 can dynamically change the latter–it may delete references or add in items that are sitting within the directory structure that just obfuscates what is happening. In the “ownable” project you can ensure which references are needed, add nuget packages, etc and have complete control to verify a successful build. Consider that clashes with the original project are something to consider. The main point is that NT8 it trying to create
“NinjaTrader 8\bin\Custom\NinjaTrader.Custom.dll” so the “ownable” project should be setup to output elsewhere (it may write to Debug/* by default for instance so its a non-issue). Then just pick and choose the minimal DLLs and “release” them into “NinjaTrader 8\bin\Custom”.
Sorry for the run-on but it was fresh as I just spent too much time on this.
Good-luck!!