.NET Framework Developer Center > .NET Development Forums > .NET Remoting and Runtime Serialization > Remoting / Serialization problem trying to Migrate to .NET 2.0
Ask a questionAsk a question
 

AnswerRemoting / Serialization problem trying to Migrate to .NET 2.0

  • Wednesday, November 15, 2006 12:17 AMTHURST80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    I am experiencing runtime errors since upgrading to the .NET 2.0 frame work.  I am getting errors trying to instantiate remote objects. I get the error:

    "The input stream is not a valid binary format. The starting contents (in bytes) are: 53-79-73-74-65-6D-2E-42-61-64-49-6D-61-67-65-46-6F ..."

    From what I can gather, this happens when IIS sends back an error message as plain text that the binary formatter doesn't know how to handle.

    Looking at the logs generated from nHibernate (our OR mapping tool) I also noticed the following error:

     

    14/11/2006 9:16:09 AM - An exception of type (SerializationException) occurred in (mscorlib)System.Runtime.Serialization.SerializationException: Type 'Nullables.NullableBoolean' in Assembly 'Nullables, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

     

    Tracing through the code it appears to through the exception on the highlighted line below.  (which does have an attribute of 'Serializable'.  This code also works in our v1.1 framework. Any ideas?

     

    [System.ComponentModel.TypeConverter(typeof(Nullables.TypeConverters.NullableBooleanConverter)), Serializable()]

    public struct NullableBoolean : INullableType, IComparable

    {

         public static readonly NullableBoolean Default = new NullableBoolean();

     

Answers

  • Wednesday, November 15, 2006 2:47 AMTHURST80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I have just figured out that the problem was because I was running a side by side execution of v1.1 and v2.0 and had not switched the version to 2.0.x in IIS.  (ASP.NET tab -> ASP.NET version combo box)

    It is all working fine now.

All Replies