<p>How can I find out the folder where the windows service .exe file is installed dynamically?</p>

<pre><code>Path.GetFullPath(relativePath);
</code></pre>

<p>returns a path based on <code>C:\WINDOWS\system32</code> directory.</p>

<p>However, the <code>XmlDocument.Load(string filename)</code> method appears to be working against relative path inside the directory where the service .exe file is installed to.</p>

Try
```
```
System.Reflection.Assembly.GetEntryAssembly().Location
```
```