.NET Framework Bookmark and Share   
 index > .NET Remoting and Runtime Serialization > System.Runtime.Serialization.InvalidDataContractException using a ObservableCollection in a Service
 

System.Runtime.Serialization.InvalidDataContractException using a ObservableCollection in a Service

Error="System.Runtime.Serialization.InvalidDataContractException: Type 'System.Collections.ObjectModel.ObservableCollection`1[T]' cannot be exported as a schema type because it is an open generic type. You can only export a generic type if all its generic parameter types are actual types."

Contract=

<ServiceContract()> P

ublic Interface ITestServer
<OperationContract()> <ServiceKnownType(GetType(ObservableCollection(Of )))> _

Function cGetSQLDataSources() As ObservableCollection(Of DarwinObjectModel.DarwinObjectModel.SQLDataSource)

another function in the Interface returns a dataset without problems (if I comment out the rogue function)

End

Interface

JohnFrench
Is this a custom class? The class DarwinObjectModel.DarwinObjectModel.SQLDataSource needs to specify DataContract attribute and all properties exposed need to specify DataMember attribute.

Happy Coding!
kashif
Kpbutt

You can use google to search for other answers

Custom Search

More Threads

• remoting with multiple clients and 1 server
• Remoting socket address problem
• Serializing DataView
• Threading issue with remoting host
• ObjectManager Memory Growth
• ??? Getting started with remoting ???
• .Net Remoting and Whidbey upgrade path
• Timeout Issue in remoting client
• .net runtime optimization service. Service reached limit of transient errors
• SerializationException on Sending Data Back to Serviced Component Via Remoting