Solved

C# - WCF + WPF + SL shared lib

Posted on 2010-09-04
3
408 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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