Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF
Hi,
I am using a 3rd Party plugin in my MVC Application.
For which i am using 1 Class.cs file & 5 .dlls.
 
Now in my WCF service i have a IService (Interface) and in my .svc.cs file i am using the [operation contract] defined in the IService .
I have few 3 paratemeters used in the contaract to access the method in Class.cs
 
Now while trying to browse the WCF service it gives following Error:
 
Type 'Microsoft.TeamFoundation.Client.TfsTeamProjectCollection' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.
 

Any suggestion , PLZ help.
Posted 15-Feb-13 20:39pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you cannot access to your 3rd-party libraries, and they don't use Data Contract, you cannot make those library to comply. No luck. Think about usefulness of these 3-rd parties for your work.
 
All you can do is to wrap all 3-rd party types you need into your own types which use Data Contract. But this is very tedious work, and the result of it will be very bad for maintenance. Think about it: you will have to reproduce all you have to serialize from scratch, as you cannot use as data members [DataMember] any of the 3-rd party types. You will have to develop parallel data types and convert them from and to 3-rd party types before serialization and after serialization (see the attributes OnDeserializedAttribute, OnDeserializingAttribute, OnSerializedAttribute and OnSerializingAttribute).
 
You can somehow automate and rationalize this unpleasant work, invent some universal tricks to alleviate the burden, but you cannot avoid it. Yes, I'm sure. Using 3-rd party libraries without source code is a very questionable thing.
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 381
1 Sergey Alexandrovich Kryukov 245
2 Marcin Kozub 225
3 Praneet Nadkar 217
4 /\jmot 189
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100