SOAPFormatter "version dependency" problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wiktor Zychla

    #1

    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_XOption s id="ref-1"
    xmlns:a1="http://schemas.microso ft.com/clr/nsassem/SU2000Plus/sekretariat_RM
    %2C%20Version%3 D3.99.1371.1877 8%2C%20Culture% 3Dneutral%2C%20 PublicKeyToken% 3
    D739f0b7b1c47b1 57">

    The problem is caused by the version stamp in the key (3.99.1371.1877 8) -
    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


  • Dave

    #2
    Re: SOAPFormatter &quot;versio n dependency&quot ; problem

    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" <ieUser@microso ft.com.no.spam> wrote in message
    news:OWA8DNZiDH A.2408@TK2MSFTN GP12.phx.gbl...[color=blue]
    > 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_XOption s id="ref-1"
    >[/color]
    xmlns:a1="http://schemas.microso ft.com/clr/nsassem/SU2000Plus/sekretariat_RM[color=blue]
    >[/color]
    %2C%20Version%3 D3.99.1371.1877 8%2C%20Culture% 3Dneutral%2C%20 PublicKeyToken% 3[color=blue]
    > D739f0b7b1c47b1 57">
    >
    > The problem is caused by the version stamp in the key (3.99.1371.1877 8) -
    > 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[/color]
    the[color=blue]
    > 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[/color]
    structure[color=blue]
    > of the settings. The SOAPFormatter was the great choice until now. I have[/color]
    to[color=blue]
    > 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
    >
    >[/color]


    Comment

    • Wiktor Zychla

      #3
      Re: SOAPFormatter &quot;versio n dependency&quot ; problem

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

      ok, I've finally found the solution: I use a simple SerializationBi nder.
      thanks, anyway.


      Comment

      Working...