Have you tried adding the Serializable attribute?
See example below. You need to "attribute up" both the base class, and
subclass.
using System;
using System.Collecti ons.Generic;
using System.Text;
using System.ServiceM odel;
using System.Collecti ons.ObjectModel ;
using System.Runtime. Serialization;
namespace MyCompany.MyApp lication
{
[Serializable]
[DataContract]
public class HelpDeskTicketD ifficulty
{
[DataMember]
private Guid _helpDeskTicket DifficultyUUID;
[DataMember]
private int _helpDeskTicket DifficultyID;
[DataMember]
private string _helpDeskTicket DifficultyName = string.Empty ;
public HelpDeskTicketD ifficulty() { } //unnecessary, but a
placeholder
public HelpDeskTicketD ifficulty(Syste m.Guid
helpDeskTicketD ifficultyUUID, int helpDeskTicketD ifficultyID, string
helpDeskTicketD ifficultyName)
{
this._helpDeskT icketDifficulty UUID =
helpDeskTicketD ifficultyUUID;
this._helpDeskT icketDifficulty ID = helpDeskTicketD ifficultyID;
this._helpDeskT icketDifficulty Name =
helpDeskTicketD ifficultyName;
}
#region A
public Guid HelpDeskTicketD ifficultyUUID
{
get
{
return this._helpDeskT icketDifficulty UUID;
}
set
{
this._helpDeskT icketDifficulty UUID = value;
}
}
public int HelpDeskTicketD ifficultyID
{
get
{
return _helpDeskTicket DifficultyID;
}
set
{
_helpDeskTicket DifficultyID = value;
}
}
public string HelpDeskTicketD ifficultyName
{
get
{
return _helpDeskTicket DifficultyName;
}
set
{
_helpDeskTicket DifficultyName = value;
}
}
#endregion
}
}
"herbert" <he*****@discus sions.microsoft .comwrote in message
news:8C******** *************** ***********@mic rosoft.com...
>I defined a WCF callback contract:
<ServiceContrac t()_
Interface IEBAPEvents
'this interface defines the events to be triggered in the clients
'the EBAP pattern defines two events: a progress event and a completion
event
<OperationContr act(IsOneWay:=T rue)_
Sub OnProgressChang ed(ByVal e As FindFilesProgre ssChangedEventA rgs)
<OperationContr act(IsOneWay:=T rue)_
Sub OnFindFilesComp leted(ByVal e As FindFilesComple tedEventArgs)
End Interface
and the event args:
<DataContract() _
Public Class FindFilesProgre ssChangedEventA rgs
Inherits ProgressChanged EventArgs
...
<DataContract() _
Public Class FindFilesComple tedEventArgs
Inherits AsyncCompletedE ventArgs
When starting the WCF host an error message appears:
Error: Type 'System.Compone ntModel.Progres sChangedEventAr gs' cannot be
seria
d. Consider marking it with the DataContractAtt ribute attribute, and
marking
of its members you want serialized with the DataMemberAttri bute attribute.
How do I add an attribute to the .NET class ProgressChanged EventArgs ?
thank you very much
herbert