Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader crashes trying to load Serilog.Sinks.File.dll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NinjaTrader crashes trying to load Serilog.Sinks.File.dll

    I am trying to use Serilog and Seq for better logging of what is happening in my strategy. From some quick research, it sounds like NinjaTrader doesn't really support NuGet packages, so the best thing to do is to copy the needed DLLs into the bin\Custom directory.

    When I do this, NinjaTrader crashes on startup with the following error:

    Code:
    2025-04-05 23:06:24:160|0|4|Unable to retrieve type info for 'NinjaTrader.NinjaScript.AddOnBase' from assembly 'Serilog.Sinks.File': Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    2025-04-05 23:06:24:160|3|4|Failed load vendor assembly 'C:\Users\mirle\Documents\NinjaTrader 8\bin\Custom\Serilog.Sinks.File.dll': The given key was not present in the dictionary.​
    This seems to happen if Serilog.Sinks.File.dll is in the bin\Custom directory, even if I haven't done anything else with it. I don't know why it seems to be trying to load an addon from this assembly or why it is failing. Is there a way to figure this out or to make this work?

    Thanks

    #2
    Hello mplaisted,

    Thank you for your post.

    Have references been added to these files in the NinjaScript Editor References window?
    Are these assemblies targeting .NET 4.8?

    Documents\NinjaTrader 8\bin\Custom is the proper place for a 3rd party referenced assembly dll.

    Support for 3rd party assemblies is limited. Our team is able to assist with adding the dll and a reference to the dll, however we cannot assist with its use, or with any errors or unexpected behavior that may occur.

    With that said, we are happy to forward any insightful information we happen to be aware of.

    Below is a link to the help guide on referencing a 3rd party assembly dll.


    Any referenced managed assembly will need to target .NET Framework 4.8 or lower. Other versions of .NET will not work, such as .NET Core or .NET 5.

    It's possible to use Nuget with Visual Studio to compile dlls for use in NinjaTrader:


    Determining the targeted .NET version for an assembly dll:



    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    22 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X