On Fri, May 16, 2008 at 7:16 AM, Ola Karlsson <[EMAIL PROTECTED]> wrote:
> Hi people, > > I'm hoping to pick your brains on the "best way" of reading an XML file in > SL 2. J > > I've seen a few different approaches floating around on the web and I've > listed some below. > > · Add the XML document as an Embedded resource in the Silverlight > project and then use XDocument.Load > > · Add the XML document to the Silverlight project and use the > Webclient class, with a relative path from the ClientBin directory. > > · Add the XML document to the Web project calling the Silverlight > project and use the HttpWebRequest class with a absolute path to the file. > > I think the response to your question must not be unique for all the scenario. All the ways you have described may be useful in different cases. - Reading a small xml embedded into the xap may be useful for small & rarely-changing configurations because you have to recompile (or at least open the xap-zip and repackage it) to change the configuration - Using the webclient or another network protocol is useful for biggest & often-changing configuration or for data retrieving (wcf?) So the correct response for me is "it depend from what you are doing" :D HTH -- Andrea Boschin Microsoft(R) MVP - [Visual Developer - ASP/ASP.NET] http://blog.boschin.it http://www.xedotnet.org http://mvp.support.microsoft.com/profile/Andrea.Boschin ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net