Hi there, 
        
The issue DYNPROXY-ISSUE-85 was just created by Krzysztof Ko?mic (xtoff).
        
        Key: DYNPROXY-ISSUE-85
        Summary: False positive exception for serializable type with no 
serialization constructor
        Type: Bug
        Importance: Low
        
        Description:
        The following tests fails with exception message saying that type is 
not serializable while in fact, it is.
        [Test]
        public void SerializatingObjectsWithoutDefaultConstructor1()
        {
            var c = new ClassWithNoSerializationCtor { Property = "foo" };
            var c1 = SerializeAndDeserialize( c );
            Assert.AreEqual( "foo", c1.Property );
            var proxy = 
this.generator.CreateClassProxy<ClassWithNoSerializationCtor>();
            var proxy2 = SerializeAndDeserialize(proxy);
            Assert.AreEqual( "foo", proxy2.Property );
        }
    [Serializable]
    public class ClassWithNoSerializationCtor : ISerializable
    {
        public string Property{ get; set;}
        public void GetObjectData(SerializationInfo info, StreamingContext 
context)
        {
            
info.SetType(typeof(SerializableClassTestCase.ClassWithNoSerializationCtorReference));
            info.AddValue("Property", Property);
        }
    }
        [Serializable]
        public class ClassWithNoSerializationCtorReference : IObjectReference, 
ISerializable
        {
            private ClassWithNoSerializationCtor _item;
            public ClassWithNoSerializationCtorReference(SerializationInfo 
info, StreamingContext context)
            {
                _item = new ClassWithNoSerializationCtor();
                _item.Property = info.GetString("Property");
            }
            public object GetRealObject(StreamingContext context)
            {
                return _item;
            }
            public void GetObjectData(SerializationInfo info, StreamingContext 
context)
            {
            }
        }
        
For more, see 
http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-85
 
        
--
donjon
by Castle Stronghold
http://www.castle-donjon.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to