For example if I have a common static class has one static method that returns hello world.
public static class Common
/// Returns Hello World
public static string HelloWorld()
return "Hello World";
Then its logical that i would want to be able to share that class in 2 different versions of my application without code duplication.
With the current referencing model it leaves us in an awkward situation as we want to be able to resuse common code if possible in both applications without having to maintain two versions of the code.
I suggest one solution for Microsoft would be to provide us the ability in Visual Studio to be able to add code compliant with both the targetted version of the .NET Framework and with Silverlight. Compilation would produce us two versions of the assembly and the Silverlight version is automatically included in our Silverlight apps and the non Silverlight version for our Windows versions of our applications.
One way this could be achieved is the using a concept of Virtual Assembly reference, so rather than referencing the assembly directly, we reference a virtual assembly. So if its a Silverlight Application it will use the Silverlight version of the assembly, and if its non Silverlight it will use the non Silverlight version. The key thing about compliant projects is that non cross compatible code will fail to compile.
Anyways, I hope Microsoft looks at implementing this solution (or another solution) to this problem (especially in the Silverlight 2.0 timeframe).