Question

If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will the.Net 2.0 library dlls I create with VS2008 work with silverlight without recompilation or other alteration?

Was it helpful?

Solution

No, you will still need to recompile against the Silverlight versions of the assemblies. You can add these files to a Silverlight Class Library project "as link", sharing the same file between both projects so you at least won't have to worry about getting out of sync.

OTHER TIPS

In addition to creating the files in one project and adding them as links in the other, you might still encounter API difference between the desktop and Silverlight APIs. You can work around those code differences with #if blocks, i.e.

#if SILVERLIGHT
/* some code */
#else // WPF
/* some other code */
#endif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top