Since I can use my good old lib from Silverlight by adding a reference to it, I'd have to basically copy and paste RegularExpresionUtil.cs from project UtilLib to SilverlightUtilLib. This is very error prone as this is not the only class. So I thought, hey, I can still add reference to "SilverlightUtilLib" from "UtilLib"!

So I thought okay all i need to do is to put those common classes in SilverlightUtilLib. Then UtilLib to add reference to "SilverlightUtilLib", which would be consumed by my infamous Winform/console Hello World.

In SilverlightUtilLib
Code:
public class RegularExpressionUtil
{
public virtual bool IsEmail(string strText)
{
...
}
}


UtilLib references SiliverlightUtilLib

public class RegularExpressionUtil
{
...
public override bool IsEmail(strnig strText)
{
... different implementation ...
}
...
}
So far so good. Solution get built successfully however running time error saying cannot load System library, see below.


Code:
void main(string[] args)
{
...
if(Util.RegularExpressionUtil.IsEmail(strText)) // Runtime error saying "Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral ..."
{
Conole.WriteLine("Yes");
}
...
// make another try call direct to base implementation in SilverlightUtil also failed with same error message
if(SilverlightUtil.RegularExpressionUtil.IsEmail(strText))
{
Conole.WriteLine("Yes");
}
So, this tells me while you can reference a Silverlight lib from a non-silverlight lib library, Silverlight uses a different "System" and you'll run into runtime error.

This brings me to my questions:
1. Is my understanding right? Silverlight and non-silverlight apps references difference "System" so you cannot call silverlight lib from non-silverlight library (if so I think M$ team should put appropriate restriction "Add Reference" dialog)
2. How would you make available many library function in UtilLib to SilverlightUtilLib? duplicating individual files is very error prone and labor intensive. (For your information I plan to make available DAO through WCF but basic function like string utility... seems like the only way is for me to copy and paste...)

I really don't like the copy and paste approach.