Skip to main content

Microsoft Silverlight

Answered Question Best method to implement local config settings?RSS Feed

(0)

jbloomer
jbloomer

Member

Member

42 points

61 Posts

Best method to implement local config settings?

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
vincracker

Contributor

Contributor

3116 points

522 Posts

Answered Question

Re: Best method to implement local config settings?

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. 

jbloomer
jbloomer

Member

Member

42 points

61 Posts

Re: Re: Best method to implement local config settings?

Interesting idea, a few questions....Smile 

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?

vincracker
vincracker

Contributor

Contributor

3116 points

522 Posts

Re: Re: Re: Best method to implement local config settings?

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
kylemc

Participant

Participant

1482 points

255 Posts

Re: Re: Re: Best method to implement local config settings?

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

jbloomer
jbloomer

Member

Member

42 points

61 Posts

Re: Re: Re: Best method to implement local config settings?

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.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities