tags:

views:

130

answers:

1

I have written a C# class library (DLL) and wondering the quickest way to make this usable in Silverlight? Presumably I will have to convert it?

+4  A: 

The difference between a .NET class library and a Silverlight class library is that they reference a different set of "core" assemblies, e.g. mscorlib.dll, System.dll, etc.

  • If you have the sources: You can convert the .NET class library to a Silverlight class library simply by starting a new Silverlight Class Library project in Visual Studio and copy&paste all sources. You'd have to fix all API calls that are different in Silverlight, of course.

  • If you don't have the sources: I don't know if there's a good way to directly convert the assembly. I doubt you can just replace the references to the .NET assembles with references to Silverlight assemlies. The only way I can think of using .NET Reflector to decompile the assembly and re-compile it as above.

dtb
Re-build from source, and understand that although Silverlight is a subset of the full framework and BCL, it is a *subset* and not everything will work "as is."
Jeff Wilcox