Unable to find assembly exception,when perform deserialization

  • Thread starter Thread starter Magi02
  • Start date Start date
M

Magi02

Guest
My winforms application has custom control, one of its property "LayoutStream" is byte[] type and it is serializable property. Currently I have ported my application from 4.6 framework to NetCore 3.0 project.

While run ported NetCore 3.0 project, im getting below exception when deserialize the data from resx file.


this.control1.LayoutStream = ((SerializableByteList)(resources.GetObject("control1.LayoutStream")));


[TypeConverter(typeof(ExpandableObjectConverter))]
public SerializableByteList LayoutStream
{
get
{
return LayoutStream;
}
set
{
LayoutStream= value;
if (value != null)
this.stmLayout.Write(value.Bytes.ToArray(), 0, value.Bytes.ToArray().Length);
}
}

[Serializable]
public class SerializableByteList
{
public SerializableByteList()
{
Bytes = new List<byte>();
}
public List<byte> Bytes { get; set; }
}



Exception:

Exception thrown: 'System.Runtime.Serialization.SerializationException' in System.Runtime.Serialization.Formatters.dll
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in System.Runtime.Serialization.Formatters.dll
Unable to find assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


Could you please suggest any solution to resolve this issue?

Continue reading...
 
Back
Top