Solved

Share ServiceReferences.ClientConfig in common assembly with multiple UI projects

Posted on 2010-11-09
3
906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

690 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