PropertyChangedEventHandler cannot derive from special class System.MulticastDelegate

PropertyChangedEventHandler cannot derive from special class System.MulticastDelegate

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


jyjy posted on Thursday, May 10, 2007

I created a business object using CSLA, which gets used in a web service.  Then, I did svcutil, pointing to the web service.  The proxy code for the web service is generated.  When I include it in my client code, it says 'System.ComponentModel.PropertyChangedEventHandler' cannot derive from special class 'System.MulticastDelegate'.  Here is a part of the generated code.  Again, this is generated by the svcutil program.

namespace System.ComponentModel

{

using System;

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]

[System.SerializableAttribute()]

public partial class PropertyChangedEventHandler : System.MulticastDelegate

{

public PropertyChangedEventHandler(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :

base(info, context)

{

}

}

}

RockfordLhotka replied on Thursday, May 10, 2007

You can not directly return a CSLA-derived object as a result in a web service, due to the way .NET's XmlSerializer works. Read Chapter 11 for details on how to create data contract objects that can be safely returned from a service, and how to connect those to your business objects.

Also, this topic has come up on the forum numerous times, so you may find useful information by searching for previous threads.

jyjy replied on Friday, May 11, 2007

Cool!  I appreciate pointing me to a right direction.  For now, I don't have the book.

Is there a way to show me quickly how I can do the "DataContract" so I can move forward until

I buy the book?

Again, I really appreciate it.

Copyright (c) Marimer LLC