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
Solved

Share ServiceReferences.ClientConfig in common assembly with multiple UI projects

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio Exe Issue, 12 32
VS2015 compilation and missing DLLs 9 161
SSL WCF Service Issues - Value cannot be null 6 79
Please explain "Multi-Tenant Services" 5 99
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…
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 …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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