Deserializing an object into another namespace.
-
Is it possible to deserialize an object that was previously serialzed under different namespace. Let me try to explain this using some code:
namespace OldNamespace
{
[Serializable]
public class Class1
{
.....
}
}Now I have moved the class to a different namespace.
namespace NewNamespace
{
[Serializable]
public class Class1
{
.....
}
}The problem is that now I can't deserialize objects that were previously serialized using old code. Is their a way out. Here's the error I get: Unable to load type OldNamespace.Class1 required for deserialization. Thanks, Syed Mehroz Alam
-
Is it possible to deserialize an object that was previously serialzed under different namespace. Let me try to explain this using some code:
namespace OldNamespace
{
[Serializable]
public class Class1
{
.....
}
}Now I have moved the class to a different namespace.
namespace NewNamespace
{
[Serializable]
public class Class1
{
.....
}
}The problem is that now I can't deserialize objects that were previously serialized using old code. Is their a way out. Here's the error I get: Unable to load type OldNamespace.Class1 required for deserialization. Thanks, Syed Mehroz Alam
This might help: Advanced Binary Serialization: Deserializing an Object Into a Different Type Than the One It was Serialized Into[^]
Giorgi Dalakishvili #region signature my articles #endregion
-
This might help: Advanced Binary Serialization: Deserializing an Object Into a Different Type Than the One It was Serialized Into[^]
Giorgi Dalakishvili #region signature my articles #endregion
Thanks for a very quick reply Giorgi. Let me go through it and write back to you if it works for me.
-
This might help: Advanced Binary Serialization: Deserializing an Object Into a Different Type Than the One It was Serialized Into[^]
Giorgi Dalakishvili #region signature my articles #endregion
Wonderful :-D. It worked!! Thanks again. Syed Mehroz Alam
-
Wonderful :-D. It worked!! Thanks again. Syed Mehroz Alam
Glad to help you :)
Giorgi Dalakishvili #region signature my articles #endregion