We have a 3-tiered application with a Silverlight front-end, that queries WCF web services. This worked fine until we moved part of the application to a few Silverlight class libraries, let's say ModuleA, B and C. Those modules contain both standard classes and user controls.
Querying a web service requires a ServiceReferences.ClientConfig file. Instead of one of those in the main application, we now have one in each module. The problem is now that:
- They are not embedded in the final XAP file anymore
- Even if they were, we have 3 different files named ServiceReferences.ClientConfig, I see a conflict coming up!
Do you know how to embed those files in the XAP so that the web service calls work? Then, should we group all the web references into another class library that is in turn referenced by everyone, to avoid having 3 files with the same name?
Thanks for your help,
Romain
=============
Well it's me again, I might have solved the problem by:
- Adding all the service references in one single class library
- Making all the modules reference this single library
- Adding a link to the now unique 'ServiceReferences.ClientConfig' file in the main application, like described here: http://silverlight.net/forums/t/34747.aspx
If you don't mind I'll leave this open for a few days if anyone has any better suggestions! Thanks CraigN for your indirect help :)
Romain
====================
As a matter of interest, a common problem with putting the WCF client code in an assembly is that at runtime the ServiceReference.config file is not available to the application. To solve this, add the file to the Silverlight application project as a link.