471,605 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Deserialization and changed namespace name

Joe
We're trying to move our class the does the serialization and
deserialization to a separate class library. When deserializing the class
the binaryformatter complains about unable to resolve type. I also tried
leaving the namespace the same as before just moving the class to a
different library but I get the same error.

Is there a way I can convert the type?
Dec 1 '05 #1
2 1448
Joe,

Take a look at the BindToType method on the SerializationBinder instance
returned to you from the Binder property on the IFormatter implementation.
It should allow you to indicate that one type should be substituted for
another.

Also, you can create your own serialization surrogate which will allow
you to do intercept the serialization calls, and perform whatever you need
to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joe" <jb*******@noemail.noemail> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
We're trying to move our class the does the serialization and
deserialization to a separate class library. When deserializing the class
the binaryformatter complains about unable to resolve type. I also tried
leaving the namespace the same as before just moving the class to a
different library but I get the same error.

Is there a way I can convert the type?

Dec 1 '05 #2
Joe
The Binder worked out perfect.

Thanks!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ej*************@TK2MSFTNGP15.phx.gbl...
Joe,

Take a look at the BindToType method on the SerializationBinder
instance returned to you from the Binder property on the IFormatter
implementation. It should allow you to indicate that one type should be
substituted for another.

Also, you can create your own serialization surrogate which will allow
you to do intercept the serialization calls, and perform whatever you need
to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joe" <jb*******@noemail.noemail> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
We're trying to move our class the does the serialization and
deserialization to a separate class library. When deserializing the class
the binaryformatter complains about unable to resolve type. I also tried
leaving the namespace the same as before just moving the class to a
different library but I get the same error.

Is there a way I can convert the type?


Dec 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mike Sarbu | last post: by
reply views Thread by gavkel | last post: by
5 posts views Thread by gavkel | last post: by
3 posts views Thread by Brad King | last post: by
3 posts views Thread by parrot toes | last post: by
7 posts views Thread by PeterW | last post: by
5 posts views Thread by Greg Allen | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.