Solved

Share ServiceReferences.ClientConfig in common assembly with multiple UI projects

Posted on 2010-11-09
3
902 Views
Last Modified: 2013-11-12
Hi,
currently, I am designing a Silverlight application in which I want to have a common assembly that performs WCF web service calls, and also provides methods to process and handle data exposed by that WCF web service.

Besides this common assembly, there are several separate UI projects (XAPs) that shall make use of this assembly and its data handling methods. E.g. I would like to be able to call a method "GetUserData" defined in the common assembly (which in turn calls a web service function and processes the results) from each of the UI projects that reference the common assembly.

However, currently this requires me to copy the ServiceReferences.ClientConfig file defined in the common assembly to each UI project that wants to make use of it. Although this works fine, I feel a bit uncomfortable with copying this file around, as it creates duplicate code and potential versioning and maintenance issues. Moreover, you couldnt do so if you would like to reference a compiled common assembly outside your own solution in VS.

Is there a way to share or reference the ServiceReferences.ClientConfig from the UI project that uses it, or at least read the configuration info in this file on startup of the UI project, and then make the UI project working on this configuration.

Or does this concept mean a lack of architecture and design at all ?

Cheers,

Joerg
0
Comment
Question by:JCassardelli
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 34099610
one way of doing it is move these binding configurations to a xaml file, and then at the silver light application start up , download this xaml file, read all the info and convert into objects.Have a factory to create you service connections , and in this factory use the object you created at app start up to create the connections.
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 34099611
not sure if i gave enough info to start with, do let me know if any more is required.
0
 

Author Closing Comment

by:JCassardelli
ID: 34255715
Sorry for coming back late, was distracted by other projects.

Your solution sounds reasonable, however, as its my first Silverlight project and currently all Clients that might use it are under my/team control, I decided to keep it simple for the time being. At the moment I stay with the VS solution to add the ServiceReferences.ClientConfig file from the common data services class as a link to all projects that want to consume this common data services class.

I found that, as a Silverlight / WCF beginner (moving from "classic" ASP.NET) there are too many other hurdles to be overcome before I should start a fully-fledged code implementation at this point.

Thanks nevertheless for your useful suggestions
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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