views:

170

answers:

2

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?

+2  A: 

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.

Bill Reiss
That's a shame :( not to doubt you but do you have any reference to support this? I'd like to pass management something official
Rory Becker
A: 

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
Jimmy