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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -