How to Read Binary File to XML?

How to read the xml file from 14 hive

  • I have a custom timer job by which I need to create custom properties using an xml file (which has all the custom properties). As for the xml file, I'm thinking to create a module for it. And then let the timer job read this XML file from the 14 hive Please anyone let me know how to read the xml file from the 14 hive Thanks,

  • Answer:

    If you use Module, the file accessible by the URL. You should only activate feature that is installs this module to a web. After this you can use http://msdn.microsoft.com/en-us/library/ms476063.aspx method.

Rakie at SharePoint Visit the source

Was this solution helpful to you?

Other answers

Here is a simple code to retrieve an xml document from the hive: var path = SPUtility.GetGenericSetupPath("FileName.xml"); var text = GetContent(path); content = System.IO.File.ReadAllText(path); var doc = new XmlDocument(); doc.LoadXml(text);

Anatoly Mironov

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.