locked
Accessing external XML file in Plugin RRS feed

  • Question

  • Hi,

    I want to access some external XML files in Plugins. Can I access the XML file in Plugin?

    Where do I need to store/place the XML file ? is this under bin/Assembly

     

     

    • Moved by Mathias Schiffer Wednesday, June 3, 2009 1:05 AM English Language Post (From:Microsoft Dynamics CRM)
    Wednesday, June 3, 2009 12:49 AM

Answers

  • The location of the XML file doesn't really matter, as long as you set the correct path. I suggest putting your path in some local configuration file though (even set the XML on a local website or fileserver next to CRM). And yes, you can access any file using plugins, since its an extension.

    string path = openFileDialog1.FileName; 
    FileStream READER = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);               
    System.Xml.XmlDocument CompSpecs = new System.Xml.XmlDocument();
    CompSpecs.Load(READER); 
    System.Xml.XmlNodeList NodeList = CompSpecs.GetElementsByTagName("CompSpecs");
    Wednesday, June 3, 2009 6:52 AM