N/APosted on - 10/21/2012
Yesterday I tried to add a reference of a normal class library in a Silverlight client application using a sample PCL but in trying to do so, it gave me an error. The screenshot of the error is as follows:
The error says:
You can only add project references to other Silverlight projects in the solution.
Does anybody have any idea how to get rid of this error? I'll be really thankful to you for your help.
Waiting for your comments
Developing a Sample PCL and consuming it
This error appears because the Silverlight owns very tiny implementation of .Net framework in order to reduce download size for user. So, it is very likely that your project uses method which is not supported by .Net Silverlight framework. And to fix this problem, you need to create a Silverlight project. You can name it like project you wanted to use and add .Silverlight at the end. Then, you create folders as in your original project. Next, add files by clicking to add existing item and use a Add link and the result will only be referenced by the new project but not copied into folder physically. You can build your Silverlight assembly w/out duplicating the sources with that feature. And remember in every Silverlight assembly the Silverlight symbol will predefined.
Hope it will help you.