Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# - WCF + WPF + SL shared lib

Posted on 2010-09-04
3
Medium Priority
?
418 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

926 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