W
webq123
Hi,
I am running into this problem while deserializing the class, I do not
get this error the first time I try to deserialize but then I keep
getting this error - Unable to cast object of type ABCSettings to type
ABCSettings.
I tried closing the memory stream but no luck.Can you please help me
figure out this issue
byte[] b = Convert.FromBase64String(szSettingsSerialized);
MemoryStream oMs2 = new MemoryStream(b);
BinaryFormatter oBinaryFormatter = new BinaryFormatter();
if(this.zSettings == null)
this.xSettings = new ABCSettings()
try
{
this.xSettings =
(ABCPage.ABCSettings)oBinaryFormatter.Deserialize(oMs2);
}
catch(Exception ex)
{
this.aErrorMessages.Add("An error occurred.[" + ex.Message + "]");
}
finally
{
oMs2.Close();
}
I am running into this problem while deserializing the class, I do not
get this error the first time I try to deserialize but then I keep
getting this error - Unable to cast object of type ABCSettings to type
ABCSettings.
I tried closing the memory stream but no luck.Can you please help me
figure out this issue
byte[] b = Convert.FromBase64String(szSettingsSerialized);
MemoryStream oMs2 = new MemoryStream(b);
BinaryFormatter oBinaryFormatter = new BinaryFormatter();
if(this.zSettings == null)
this.xSettings = new ABCSettings()
try
{
this.xSettings =
(ABCPage.ABCSettings)oBinaryFormatter.Deserialize(oMs2);
}
catch(Exception ex)
{
this.aErrorMessages.Add("An error occurred.[" + ex.Message + "]");
}
finally
{
oMs2.Close();
}