Serialization issue with .NET 4.0 and .NET 4.5 beta

Serialization issue with .NET 4.0 and .NET 4.5 beta

Old forum URL: forums.lhotka.net/forums/t/11242.aspx


robertoh posted on Tuesday, March 20, 2012

Hello guys,

we're using CSLA 4.3 in a distributed environment and encountered the following issues with the usage of the data portal:

There was an error while trying to deserialize parameter http://ws.lhotka.net/WcfDataPortal:request. The InnerException message was 'Member 'm_identity' was not found.'.

After some investigation we figured out that this is caused by the fact that the server was running on a machine that had a .NET 4.5 beta installed and the client was running with a 'pure' .NET 4.0 installation; the same is true when the server is running on 'pure' .NET 4.0 and the client on a .NET 4.5 beta machine.

Everything works fine if both machines have exactly the same .NET runtime version / installation; either two times 'pure' .NET 4.0 or two times .NET 4.5 beta.

There are some changes in the serializer in the 'patched' .NET 4.0 runtime (which comes with the installation of the .NET 4.5 beta installation).

Is this a known issue?

Thanks for information and help!

Regards,

robert.oh.

RockfordLhotka replied on Tuesday, March 20, 2012

This wouldn't be the first time Microsoft has changed the serialization format out from under us.

But it would be the first time they were incompatible since the .NET 1.0 to 1.1 fiasco.

I suggest you do two things:

  1. Submit a bug to Microsoft via connect, so they know they are potentially repeating the 1.0 to 1.1 mess
  2. Try using the new binary reader/writer Sergey created for CSLA 4.3 - they probably won't have this issue because it is CSLA code doing the low-level creation of the byte stream; no guarantees, but it might be a workaround

 

RockfordLhotka replied on Tuesday, March 20, 2012

Oh wait, sorry, my workaround isn't available if the client is .NET :(

So I don't have a real workaround to suggest. Microsoft must have changed how the NDCS works in 4.5 (I'm assuming you are using WcfProxy), and to me that sounds like a bug in .NET.

robertoh replied on Tuesday, March 20, 2012

Hello Rocky,

thanks for the fast answers.

You're right, we're using the WcfProxy and we will create a Microsoft bug in connect.

Thanks,

robert.oh.

BGrojer replied on Thursday, March 22, 2012

Connect issue is here:

https://connect.microsoft.com/VisualStudio/feedback/details/732591/serialization-issue-with-net-4-0-and-net-4-5-beta

Copyright (c) Marimer LLC