Sharing Silverlight Assemblies with .NET Apps – Kind of


For SL 4 and .NET 4, the following assemblies are portable at the Siverlight surface area:

  • Mscorlib
  • System
  • System.Core
  • System.ComponentModel.Composition
  • Microsoft.VisualBasic

There are a great number of types and members in the .NET surface area that cannot run on Silverlight. As a result, you need to write code that targets the Silverlight versions of these assemblies in order to get this scenario to work.

Developers should write their portable logic in Silverlight Class Library projects, and then are free to reference such projects from both Silverlight and .NET application projects. To clarify, on the .NET side, you can reference such a library (Binary) from any kind of .NET project (Ex: WPF, winforms, WCF, WF, ASP.NET, …).

The following are the basic steps to follow to enable the use of portable code in Visual Studio 2010

Steps:

  1. Setup projects
    1. Create .NET application
    2. Create or add existing Silverlight class library project
    3. Build Silverlight project
  2. Establish portable code reference
    1. Reference Silverlight class library binary from the .NET project
  3. Code
  4. Run App!

CLR Team Blog : Sharing Silverlight Assemblies with .NET Apps

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s