Search code examples
.netsilverlight-4.0assemblies

How to use Silverlight as a presentation layer for .Net assembly/code?


We have following layers in our app all layers are built on .Net 2.0

  • Object library[ used across all layers]
  • Win Form client
  • Asp.Net web service
  • Business Logic library
  • Database Access Layer
  • Database

What would be the best way to move forward to have Silver Light as another presentation layer. I thought I could just add new Silverlight layer by referencing Object library in Silverlight app and calling web service . But seems like its not possible. Refer CLR Team Blog.

Any architectural insights?

Thanks.


Solution

  • When you want to reuse code, you have basically three options:

    • Generally create all your basic class libraries as a Silverlight class library project, because it is the framework with the lowest set of features. Throw all references out except for mscorlib.dll, System.dll and System.Core.dll. You can then link such kind of Silverlight library in any full .NET project.

    • You can link individual code files from another project with the "Add as link" feature (Right click project -> Add Existing Item -> Change "Add" Button to "Add as link"). That way you can create a Silverlight project and link individual files from your full .NET project. However that can get tedious if you have a lot of files and you often add/remove files and folders in your source project.

    • To cure this problem, you may check out the Project Linker at http://msdn.microsoft.com/en-us/library/dd458870.aspx ... but I haven't tried it myself yet.