I have been developing a WinService application and testing the methods and functionality using WinForms application.
I have one solution and both applications are under the same solution. Application logic and methods are inside WinService project under public class and methods, so that I can test methods separately.
The WinService application is linked to Windows Forms application using reference. This gives me the opportunity to initialize methods inside WinService applications public class.
Solution
|
|
|--- WinForms
| |
| |--- bin
| |
| |--- WinForms.exe
| |--- WinForms.exe.cofig
| |--- WinService.exe
|
|--- WinService
The problem is that when using Forms application the app.config changes are not making any difference and values returned are always the same.
I access app.config settings like this
Properties.Settings.Default.App_config_settings_item_name
It seems that when building solution it copies WinService.exe to bin folder of WinForms application, but the app.cofig file is missing.
I have tested to copy this app.config from WinService bin folder, but it doesn't make any difference. It looks like the app.config values are "hard coded" inside WinService.exe and even app.cofig files are not changing those values.
What would be the correct way to use app.config properties?