Extending .NET 2.0 class library for WCF use -
we publish class library must remain compatible .net 2.0. however, use class library internally wcf-based projects.
reading e.g. expose-object-from-class-library-using-wcf brings approach using 2.0 class libraries creating datacontractsurrogate objects map 2.0 classes. however, our object hierarchy rich , deep, , tedious , difficult maintain.
since control source code, i'm looking easier approach.
one thought add dataconract attribute source code, , provide "empty" implementation of datacontractattribute when solution built targeting 2.0 runtime, , using system.runtime.serialization implementation when solution built targeting 3.0 , newer runtimes. accomplished manually tweaking references between builds.
is there better way implement approach?
is there better approach?
an alternative approach add wcf attributes (datacontractattribute etc), , build .net 3.0 assemblies.
when run application under .net 2.0, having attributes assembly not available @ runtime won't cause problem.
(you error if try access attributes, unlikely , easy avoid).
Comments
Post a Comment