Adding C# library reference to Silverlight project

A

Abbas

Does anyone know how to utilize a C# class within a silverlight
project?

I was trying to add a reference to my non-silverlight Class Library
and the VS 2008 IDE told me "You can only add project references to
other Silverlight projects in the solution".
 
N

Nicholas Paldino [.NET/C# MVP]

Abbas,

I don't think that you can do this. AFAIK, Silverlight uses a separate
implementation of the CLR, and you can't add a reference to an assembly
compiled for the .NET CLR, which is why you have to add a reference to
another Silverlight project.
 
B

Ben Voigt [C++ MVP]

Nicholas Paldino said:
Abbas,

I don't think that you can do this. AFAIK, Silverlight uses a separate
implementation of the CLR, and you can't add a reference to an assembly
compiled for the .NET CLR, which is why you have to add a reference to
another Silverlight project.

IOW, you can reference the source files, but not the compiled output?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Abbas said:
Does anyone know how to utilize a C# class within a silverlight
project?

I was trying to add a reference to my non-silverlight Class Library
and the VS 2008 IDE told me "You can only add project references to
other Silverlight projects in the solution".
 
A

Abbas

From what I have found is that you indeed cannot add a reference to a
C# class library. All you can do is add the class as a link to your
Silverlight project, but it will still be compiled using the
Silverlight DLLs rather than the .NET CLR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top