Install a windows service twice

G

Guest

Hi,

i have written a windows service which synchronizes data between databases.
This service is running on a database server which holds production and test
databases.
Data access takes place using webservices.
Information on webservice URLs and database connection strings are stored in
the applocation configuration file (app.exe.config).

After doing some changes on the service I now need to install a test version
of this service with different config-settings (URLs and connectionstrings of
test webservices and test databases).

How can I install a new test-version of my service without affecting the
running production service?

regards
Michael
 
S

Steven Cheng[MSFT]

Hello Michael,

From your descrpition, you have an .NET built windows service which will
pickup some values from app.config file to initialize some components. Now,
you 're wondering how to install a test service with some test data(in
config file) without affect the existing running service, right?

Regarding on this issue, here are some of my suggestion:

For windows service, in .NET I think you've used an ServiceInstaller class
(and the InstallUtil.exe tool) to install it, right? If so, you can open
the autogenerated code section of your installer class and you'll find the
following like code:

<<<<<<<<<<<<<<<<<<<<<
// serviceInstaller1
//
this.serviceInstaller1.Description = "My Install Service
Description";
this.serviceInstaller1.DisplayName = "My Install Service";
this.serviceInstaller1.ServiceName = "Service1";
these indicate the properties that the installer will set for your windows
service, and the "ServiceName" is the most important one since it identify
a service. For your test service, you can modified these properties to some
test that representing a testing service. Also, you can double click the
installer class and see these properites setting in the Properties
window(when you select the installer class in component panel):

#ServiceInstaller Class
http://msdn2.microsoft.com/en-us/library/system.serviceprocess.serviceinstal
ler.aspx

After you modify this and build to run the new installer one, it will
install the service under a different identity separated from the original
one. What do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
 
M

Mr. Arnold

FreeNEasy said:
Hi,

i have written a windows service which synchronizes data between
databases.
This service is running on a database server which holds production and
test
databases.
Data access takes place using webservices.
Information on webservice URLs and database connection strings are stored
in
the applocation configuration file (app.exe.config).

After doing some changes on the service I now need to install a test
version
of this service with different config-settings (URLs and connectionstrings
of
test webservices and test databases).

How can I install a new test-version of my service without affecting the
running production service?

I think it's kind of simple. You make a new name for the service called
"TestService" as an example and install it and make the Web service
TestWebService in the name.

Why do you need to make it anymore complicated than that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top