How to use the same class library in WCF and Silverlight applications

Hey. I would like to use the same class library from my Silverlight application and WCF-based services. I created the Silverlight C # class library and found that the WCF service does not allow you to add a reference to Silverlight project types. So

  • What should I do to make this work?

  • Can Silverlight call methods in the Silverlight class library if it interacts with the WCF service?

  • Is Silverlight always so difficult?

+3
source share
3 answers

2 , Silverlight WCF. #. ( Visual Studio : , "" " ".

, . , .

+1

: D - .shared. . : http://msdn.microsoft.com/en-us/library/ee707371(v=vs.91).aspx

PS: .shared, :

#if SILVERLIGHT
        MessageBox.Show("yay, I will run only on silverlight");
#endif
+1

All Articles