Skip to main content
Home Forums Silverlight Programming WCF RIA Services Best method to implement local config settings?
5 replies. Latest Post by jbloomer on July 7, 2009.
(0)
jbloomer
Member
42 points
61 Posts
07-03-2009 8:30 AM |
I'd like to use some web.config style settings in my Silverlight application for deployment dependent values.
Does anyone have opinions on the best way, or the correct way to do this?
InitParameters on SilverlightApplication allows comma separated values, but somehow this feels wrong compared to editing a web.config file.
Or you could write a web service to call into the config file, but then you have to write another web service.
Is there a different way? A "RIA" approach?
vincracker
Contributor
3116 points
522 Posts
07-03-2009 8:44 AM |
I personally use XML files, stored on server. In my client app, I download those files, parse them and use my setting configuration. Also they are cute xml files, so can edit anytime.
07-03-2009 11:39 AM |
Interesting idea, a few questions....
Do you do a simple WebRequest and treat the XML files as any old content? Or wrap them in a web service? What do you do with regards to security?
07-04-2009 1:19 AM |
I used this approach in one of my Game, and in that I just hosted it on server, because there is no need to secure it. But if we want some sensitive data to be placed in config xml file then you have to use user authentication with WCF method. Or let me know any other idea of securing it. I would love to hear that.
kylemc
Participant
1482 points
255 Posts
07-06-2009 11:00 AM |
I've considered using a DomainService to serialize the content as a string and possibly reconstruct it into something more useful on the client. That would provide the security benefits of the RIA Services framework. Would that be useful, or is it more work than benefit?
Kyle
07-07-2009 4:18 AM |
Yeah, I like the idea of using the RIA framework. I suppose I could even parse the config file server side and just return the value that I'm after.
I forgot I could just create a ServiceOperation to do that, I think I'll give it a go.