<p>In VS2008 I have written a C# service, an installer, and have created a setup package to install it. The service needs to load an xml file to operate. Where is the best place to put this file in the various filesystem folders offered by the VS setup project, and how do I then refer to these paths from my code?</p>
<p>I should point out the the service runs as <code>LocalService</code>, which means that the ApplicationData folder offered by the &quot;User's Application Data Folder&quot; item in the VS setup project is not accessible, even when &quot;Install for all users&quot; is used during installation. I could easily hack around this, but would like to understand best practice.</p>

I am not sure which place is better to store the XML file. I don't think it will matter alot. But if you need to get special folder path in the system you can use Environment class to do so. The following line of code get the path of the Program Files:
```
```
string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
```
```