468,484 Members | 1,765 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

dynamic windows service name

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

Nov 20 '05 #1
0 719

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rami Saad | last post: by
8 posts views Thread by Eyeawanda Pondicherry | last post: by
15 posts views Thread by Nak | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
7 posts views Thread by Mike Livenspargar | last post: by
4 posts views Thread by tshad | last post: by
1 post views Thread by =?Utf-8?B?Sm9yZGFuIFou?= | last post: by
5 posts views Thread by dm3281 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.