MC .NET 8.1 ERROR of DeSerialization on object

Questions about MultiCharts .NET and user contributed studies.
Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

MC .NET 8.1 ERROR of DeSerialization on object

Postby Emmanuel » 25 Dec 2012

Hi,

I am using object Serialization to save Object on file on the Hard Drive. Serialization is very effective to save object with its data.

With MC .NET, we can Serialize to the Hard Drive, but I get an ERROR MESSAGE when I DeSerialize the Object :

The input stream is not a valid binary format. The starting contents (in bytes) are...
or
Impossible to find assembly '0xnbic15, Version=0.0.0.0, Culture=neutral, publicKeyToken=null'.
The following example work well without MC.Net in Visual Studio, but if we use it with MC .NET 8.1 we get an ERROR in

Sub TestSerializationDeSerialization()
at the line :

DeserializeItem(fileName, formatter)


1/ Does any one have the error with this example ?

2/ How can we make this line DeserializeItem(fileName, formatter) work ?
Attachments
Mov_Avg_AdaptiveVB.Indicator.rar
(1.7 KiB) Downloaded 274 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MC .NET 8.1 ERROR of DeSerialization on object

Postby Henry MultiСharts » 26 Dec 2012

Hello Emmanuel,

A new build with a new name is created each time you compile a study.
BinaryFormatter uses full name of "AssemblyName + Full Type Name" type for Serialization/DeSerialization. That is why the types declared in the class of your indicator or signal change their full name each time you recompile the study in PL.NET.


Return to “MultiCharts .NET”