I have a service with the app.config file that is used during installation. In the ProjectInstaller class, there is code to read the app.config file, pull out the credentials and install them. The goal is to not show the user / password prompt.
In the examples below, serviceUser
and servicePassword
are just private lines of objects.
The next block (located in ProjectInstaller ctor) works correctly. That is, it sets the data for entering the service and never asks the user:
public ProjectInstaller() { InitializeComponent(); LoadServiceSettings();
However, the following does not work:
public ProjectInstaller() { InitializeComponent(); LoadServiceSettings();
Why does it matter whether the line is hard-coded or not? It is also worth noting that in my app.config I do not escape the slash ... because it is not an escape xml character.
Why is this failing?
EDIT: "failing" I mean, the installer asks for a password, and everything that the user puts in the serviceUser
and servicePassword
overrides.
source share