1

I have a SilverLight 5 solution with 2 projects by default. (MyProject & MyProject.Web)

I have decided to split projects to have a more readable solution.

I added MyProject.Controls and MyProject.BLL.

And now I would like to use classes from the Entity FrameWork of my MyProject.Web into MyProject.Controls or MyProject.BLL.

But when I try to add a reference to MyProject.Web , I get the error : "You can only add project references to other Silverlight projects in the solution".

How can I solve this so I can use the classes from the Entity Framework into all the projects in the solution ?

Thanks

Oliver
  • 807
  • 2
  • 12
  • 23

1 Answers1

1

It is not possible; Silverlight does not support Entity Framework libraries.

Silverlight applications can not connect to SQL server directly; you only have one option: Creating web services (or WCF) to expose you SQL server operations to Silverlight client.

daryal
  • 14,643
  • 4
  • 38
  • 54
  • Is it possible to use the "Add as link" method ? Like explained in this post ? http://stackoverflow.com/questions/11905622/sharing-classes-between-server-and-client-projects-in-silverlight?rq=1 – Oliver Dec 17 '13 at 10:18
  • for some classes it is possible; but since EF requires SQL server access it is not possible. – daryal Dec 17 '13 at 12:17
  • @Oliver Add as Link option is to share common resources.. say enumerations from server to silverlight... you won't get any benefit by adding EF model files as 'Add as link' in silverlight project. – Sameer Azazi Dec 18 '13 at 07:01