Solved

C# - WCF + WPF + SL shared lib

Posted on 2010-09-04
3
411 Views
Last Modified: 2012-05-10
Hi,
i am currently developing a Client/Server achitecture based on Windows Communication Foundation technology.

In my solution, i have a Self-hosted WCF service in a WPF Application, a WPF client application, a Contracts/Data library with severals interfaces and classes used as servicecontract and knowntype in the WCF service.

For now, everything work when connecting the WCF service with the WPF client with the contracts/data library as reference in both.

But now im facing a problem where i need to create a silverlight client that will re-use the same contracts/data library and be able to communicate with the WCF service(just like the WPF client is doing it).

Since we cant use Windows based library as reference in a silverlight application, what should i do now?

Thanks in advance!
0
Comment
Question by:Enill
3 Comments
 
LVL 11

Expert Comment

by:lenordiste
ID: 33607843
I would advise you to follow SOA/SAAS guidelines if you are building a service that should be able to interact with different client types.
That said, everything should be fine in the scenario you described above as long as the "shared library" only contains contract information. Any other information should not be shared and should only be known to your WCF service.

what are you calling "windows based library"?
0
 

Author Comment

by:Enill
ID: 33608970
By '"Windows based library" i mean that a library project created in Win32/WPF cant be used directly in a silverlight application by adding it as reference.

This is causing a problem where the same type of object need to be managed on silgerlight side than WPF client side(and server). Those types are my "custom" made communications packets classes.
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 33611200

1.  Create a project, Create one more project of type "Siliverlight ClassLibraray" in the WCF server solution file.
2. Add files. Right on the above silverlight project and select "Existing item" . Select your existing Windows based library file. But before client "Add" button select the down arrow and select "Add as link".

In this way you have one source. When you update in windows based library, ur Silverlight libraray also will be updated automatically every time u build. The will create a Silverlight DLL. Now point to this DLL in your silverlight application.

Hope it helps.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question