title: C# Windows Service - Read from ini or App.config file
body: <p>I have one Windows Polling Service to send an automatic email each 10 minutes. I use <code>Thread.Sleep(new TimeSpan(0, 10, 0));</code> to sleep the thread for 10 minutes, which is hard coded right now.</p>
  
  <p>To avoid hard coding, I have tried <code>App.config</code> which was not successful. I want to move the hard coding to some <code>.ini</code> files. How can I read <code>.ini</code> file from C# Windows Service.</p>
  
  <p>EDIT: I try the below code to read from my windows service.
  <code>string pollingInterval = (string)new AppSettingsReader().GetValue("PollingInterval", typeof(string));</code>
  Gives the below error. <code>Configuration system failed to initialize</code></p>