Unhandled exception when saving

Post Reply
Khan
Posts: 137
Joined: Wed Feb 22, 2023 10:21 am

Unhandled exception when saving

Post by Khan »

Hi,

These days I tend to get an exception when I'm saving a backtest. I don't know whether the save was successful, but in any case when I exit NM, the backtest is saved and seems to be fine.

This bug seems to occur after I duplicate some chart objects and change their templates.

The relevant stack trace:

Code: Select all

#####-- 08/03/2024 14:37:08 --#####

System.Runtime.Serialization.SerializationException: Type 'NakedMarkets.Classes.GraphicsManagement.Charts.CrossUserGraphObject' in Assembly 'NakedMarkets, Version=1.0.8822.32405, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)

   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)

   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)

   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)

   at ’™.—˜(Object , Stream , Object , ’™ )

   at NakedMarkets.Classes.BackTest.SaveBacktest(BackTest backtest)

   at “™Œ.—˜(BackTest backtest, “™Œ )

   at NakedMarkets.MainForm.saveToolStripMenuItem_Click(Object  , EventArgs  )

   at ——œ.—˜(Object , Object  , EventArgs  , ——œ )

   at NakedMarkets.Classes.Settings.HotkeyDelegate.SaveBacktestForm(Object  , EventArgs  )

   at NakedMarkets.MainForm.œŒ‡(Object , Object , Object )

   at NakedMarkets.MainForm.MainForm_KeyDown(Object  , KeyEventArgs  )

   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)

   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)

   at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)

   at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)

   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)

   at System.Windows.Forms.Control.WmKeyChar(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.UserControl.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thanks.
NakedMarkets
Posts: 251
Joined: Tue Feb 22, 2022 11:06 am

Re: Unhandled exception when saving

Post by NakedMarkets »

Thanks for your report Khan,
This was a bug when saving the backtest file (likely through a shortcut) trying to save the crosshair object.
It has been fixed and will be available in the next release
Khan
Posts: 137
Joined: Wed Feb 22, 2023 10:21 am

Re: Unhandled exception when saving

Post by Khan »

Yeah, indeed I use a custom assigned shortcut to save backtests.

Thank you.
Post Reply