Reputation: 1453
I have created a Windows Service that reads various paths from the app.config file and works correspondingly.
I also use the 'Visual Studio Installer' as a installer for my Service.
This is my project structure:
However, when I build the Installer, it does generate the .msi and .exe used to install my service, but it doesn't include the config file that it needs to use to fetch the paths it's using:
Normally, the only thing that I use is the .msi file to install and run the Windows Service (it works perfectly using hardcoded paths) but I can't seem to use it in combination with the config-file.
What I tried is to copy the config file from the service project, and paste it in the folder of the second screenshot, but the service doesn't work when I try to install and run it that way.
What am I doing wrong?
EDIT
I tried adding the .config file manually in the installer project:
Without success however
Upvotes: 1
Views: 1928
Reputation: 5150
App.config
is a part of the Service
project and NOT of the installer.
It will be in the target installation folder
of your Service assembly after installing.
Also App.config
will be renamed according to the project's assembly name.
Your assembly name is Watcher.Service
, your .exe
will be, after compiling Watcher.Service.exe
and your app.config
now will have the name Watcher.Service.exe.config
.
Upvotes: 2