469,631 Members | 1,281 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

SOAPFormatter "version dependency" problem

After signing all my assemblies with strong keys, I've found that the
application refuses to deserialize any SOAP serialized data. The message
says:

Parse error, no assembly associated with the Xml key.

and refers to the Xml key:

<a1:C_XOptions id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/nsassem/SU2000Plus/sekretariat_RM
%2C%20Version%3D3.99.1371.18778%2C%20Culture%3Dneu tral%2C%20PublicKeyToken%3
D739f0b7b1c47b157">

The problem is caused by the version stamp in the key (3.99.1371.18778) -
after each rebuild the version number is incremented and the deserializer
cannot deserialize the data serialized by the previous version.

Alas, I did not find any simple way to solve the problem. How do I make the
SOAPFormatter version independent? Note that the problem started to occur
after I've signed all assemblies.

I use SOAPFormatter to store the internal settings of my application. I
cannot use XmlSerializer because it cannot handle the complicated structure
of the settings. The SOAPFormatter was the great choice until now. I have to
find a way to make it "version independent" because it would be really
annoying for the user to lost his/her setting with each new version of the
application.

Is there any simple solution? Thanks in advance for any help,
Wiktor Zychla
Nov 11 '05 #1
2 4591
Use a serialization Binder to control the types the formatter creates. In
the binder code you can take an old type and tell the runtime to use the
current type. Jeff Richter wrote 3 articles on this subject - here's a link
to the 3rd one.
http://msdn.microsoft.com/msdnmag/issues/02/09/net/
"Wiktor Zychla" <ie****@microsoft.com.no.spam> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
After signing all my assemblies with strong keys, I've found that the
application refuses to deserialize any SOAP serialized data. The message
says:

Parse error, no assembly associated with the Xml key.

and refers to the Xml key:

<a1:C_XOptions id="ref-1"
xmlns:a1="http://schemas.microsoft.com/clr/nsassem/SU2000Plus/sekretariat_RM %2C%20Version%3D3.99.1371.18778%2C%20Culture%3Dneu tral%2C%20PublicKeyToken%3 D739f0b7b1c47b157">

The problem is caused by the version stamp in the key (3.99.1371.18778) -
after each rebuild the version number is incremented and the deserializer
cannot deserialize the data serialized by the previous version.

Alas, I did not find any simple way to solve the problem. How do I make the SOAPFormatter version independent? Note that the problem started to occur
after I've signed all assemblies.

I use SOAPFormatter to store the internal settings of my application. I
cannot use XmlSerializer because it cannot handle the complicated structure of the settings. The SOAPFormatter was the great choice until now. I have to find a way to make it "version independent" because it would be really
annoying for the user to lost his/her setting with each new version of the
application.

Is there any simple solution? Thanks in advance for any help,
Wiktor Zychla

Nov 11 '05 #2
> Is there any simple solution? Thanks in advance for any help,

ok, I've finally found the solution: I use a simple SerializationBinder.
thanks, anyway.
Nov 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by (Pete Cresswell) | last post: by
2 posts views Thread by DraguVaso | last post: by
2 posts views Thread by Wiktor Zychla | last post: by
6 posts views Thread by **Developer** | last post: by
reply views Thread by =?Utf-8?B?QmVybnJkIE5vcm1pZXI=?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.