Solved

C# - WCF + WPF + SL shared lib

Posted on 2010-09-04
3
406 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
Comment Utility
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
Comment Utility
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
Comment Utility

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now