The problem is that whatever I put in the config file (Service1.exe.config) or even delete it - Windows Service simply doesn't care, it still pulls data from somewhere. I also noticed when I was searching for a value in files (searching for a string), I found it in the exe file of the service!? How is this possible? What can I do to change this behaviour? Thanks
SMARTService.Properties.Settings propRemote;
SMARTService.LocalSettings propLocal;
SMARTService.smtp propSmtp;
protected override void OnStart(string[] args)
{
propRemote = SMARTService.Properties.Settings.Default;
propLocal = SMARTService.LocalSettings.Default;
propSmtp = SMARTService.smtp.Default;
}
And later I used them throughout code.
The settings file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="SMARTService.smtp" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="SMARTService.LocalSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="SMARTService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<applicationSettings>
<SMARTService.smtp>
....
</SMARTService.smtp>
<SMARTService.LocalSettings>
....
</SMARTService.LocalSettings>
<SMARTService.Properties.Settings>
....
</SMARTService.Properties.Settings>
</applicationSettings>
</configuration>