Solved

Share ServiceReferences.ClientConfig in common assembly with multiple UI projects

Posted on 2010-11-09
3
901 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 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

20 Experts available now in Live!

Get 1:1 Help Now