CLR 4 Compatibility in Silverlight 4

I was watching a great presentation that Ward Bell put together recapping PDC '09 and stumbled on one of his last slides which purports; ".NET 4<br/> Same CLR in Silverlight & .NET" and was a bit perplexed, so I dug into the concepts behind that title a bit.  It turns out that Ward was referring to a new feature in .NET 4 called "assembly portability".  Richard Lander does a great job explaning this on the CLR Team Blog

In summary; you can compile Silverlight 4 Class Library projects and reference them in both SL4 and .NET 4 (WPF,WinForms, etc…) provided the SL Class Library does not reference anything outside of these specific assemblies:

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

The net benefit of this is that you can write your reusable logic and compile it to SL4 Class Libraries and your assembly will be usable by both .NET 4 and Silverlight 4 without recompilation.  Pretty cool!

Comments (0)

Skip to main content