Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Serialization of class always fails

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

    Serialization of class always fails

    Hello,

    I've a bit of a weird one that I think is Ninjtrader internals-related, perhaps, so I am asking for your feedback.

    I have a .net 4.8 class I developed as an external dll. I added it as a reference. It all works in every aspect perfectly fin in ninjascript indies etc., except for this one thing. I have a 'save' option in the class which when called from a test project outside of NT8, works OK. The save method works by serializing the class object with a binary formatter. The load, the reverse, i.e. class = (cast)formatter.Deserialize(fs); I do this with other types in different places OK. When I do it within NT with this referenced class, I get a file not found error when the load is attempted, and that file is the referenced dll. This makes not a lot of sense as the DLL is obviously already being used in the various NT8 indies just fine. It's only when you try to serialize and desirealise and recreate the object this occurs.

    Is this perhaps a known issue? Is there a workaround?

    Thanks.

    #2
    Hello pjsmith,

    From the given details I wouldn't be sure what is happening, we would need to know the specific error that you get along with a small sample that demonstrates the problem so we can see what code was used. Because the binary formatter is a part of C# and not NinjaScript it may be how you are using it from within NinjaTrader that is causing a problem.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    553 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    100 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    543 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    546 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X