oal
oal

Reputation: 411

Configuration files in Silverlight

I am writing a plugin for Seesmic Desktop 2, and this being my first time using Silverlight, I have a question:

Writing Windows apps, we have the application configuration file e.g. MyApp.exe.config that is used to store config values, and for the web we have Web.config. For Silverlight, there doesn't seem to be the same thing. Ok, there's not quite the same incentive, as you have to unzip the .xap package to access it, but even so...

My issue is that I have data, e.g. JSON web service enpoint URIs that I feel uncomfortable embedding directly in code, as they would normally go in .config files. Is there any equivalent/way around this for SL?

Upvotes: 7

Views: 6646

Answers (2)

Mazhar Karimi
Mazhar Karimi

Reputation:

Store all your configurations in your Web Application Configuration file, and at you page (which hosts the SL ) get all the configuration from you web.config, and pass to SL via SL's initial parameters.

For further help you visit this:

http://www.codeproject.com/KB/silverlight/SilverlightWebConfig.aspx

Upvotes: 3

oal
oal

Reputation: 411

I've found a resource that seems to address the issue by creating a normal XML file, and then using custom functions to load configuration settings from (and to?) the file. Failing any better solution, I will have to do this.

Upvotes: 4

Related Questions