By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

dynamic windows service name

P: n/a
Hi all,

I am trying to install a service using dynamic naming. I wrote values in the
configuration file, and trying to assign one of those values to a string,
and using this string as the name of the installer

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<appSettings>

<add key="StringName" value="StringValue" />

</appSettings>

</configuration>

//Code in the service installer

str=System.Configuration.ConfigurationSettings.App Settings["StringName"];

this.serviceInstaller1.ServiceName=str;

when using the installutil tool, I get the following exception:

An exception occurred during the Install phase.

System.ArgumentException: Must specify value for source.

Usually, if I write the string value in a normal text file, and read the
value from the file while installing (instead of reading from the
appSettings element) I don't get any exceptions and it works fine..

So what could be the reason then? and normally how can you set a dynamic
service name using the configuration file?

Thank you for your help
--
Rami Saad
Microsoft GTSC Developer support for Middle East

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.