-
March 10th, 2009, 10:25 PM
#1
[Serializable] ---> seems like [IgnoreDataMember] was ignored by WCF?
hello
I'm using [Serializable] for my class (i.e. not labeled wih [DataContract] ---> seems like [IgnoreDataMember] is ignored?
[Serializable] *** Not [DataContract]
public class A : ISerializable
{
...
[IgnoreDataMember()]
List<T> lstNames;
...
}
I called service which return A. The reason why I think IgnoreDataMember was not applied is because from SvcTraceViewer I get this message:
Type 'System.Collections.Generic.List`1
[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10...ization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
I need to "Ignore" the property and I've tried "IgnoreDataMember" as well as "XmlIgnore", can't get pass this. Is it because [KnownType("GetKnownType")] attribute is also ignored when you use [Serializable] instead of [DataContract] attribute?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|