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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X