473,241 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Windows Service Deployment

I have a Windows Service that I am deploying by setting a Deployment project
in my solution.

The problem I am having is with the app.config file. This where we store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well as a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom
Jun 27 '08 #1
5 2129
Generally what I do is add an app.config to the application (so the setup can
see and deploy it). Then, I add several other application configurations,
one for each scenario. For example, I'll have the main app.config,
dev.config and release.config.

Then, for each configuration I have a pre-build event that copies the
appropriate config on top of app.config. I then only edit only dev.config or
release.config. This means the appropriate app.config exists in the bin
directory, plus it means when I build the setup the contents of the
release.config is used.

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"tshad" wrote:
I have a Windows Service that I am deploying by setting a Deployment project
in my solution.

The problem I am having is with the app.config file. This where we store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well as a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom
Jun 27 '08 #2
On May 6, 12:42*pm, "tshad" <ts...@dslextreme.comwrote:
I have a Windows Service that I am deploying by setting a Deployment project
in my solution.

The problem I am having is with the app.config file. *This where we store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well as a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom
Hi,

Not that I know of. Of course you can change it in your project just
before generating the MSI :)
Now, if each client has a different config file, then you have a
similar problem.
What if you include another program that simply edit the config file
in a user friendly way?
Jun 27 '08 #3

"Peter Ritchie [C# MVP]" <PR****@newsgroups.nospamwrote in message
news:EB**********************************@microsof t.com...
Generally what I do is add an app.config to the application (so the setup
can
see and deploy it). Then, I add several other application
configurations,
one for each scenario. For example, I'll have the main app.config,
dev.config and release.config.

Then, for each configuration I have a pre-build event that copies the
appropriate config on top of app.config. I then only edit only dev.config
or
release.config. This means the appropriate app.config exists in the bin
directory, plus it means when I build the setup the contents of the
release.config is used.
So do you have the 3 config files outside of the solution folders and then
copy (and rename them - ie "copy dev.config app.config")?

How do you do the pre-build event?

Thanks,

Tom
--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"tshad" wrote:
>I have a Windows Service that I am deploying by setting a Deployment
project
in my solution.

The problem I am having is with the app.config file. This where we store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well as
a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom

Jun 27 '08 #4
Right-click project node in Solution explorer, then properties, and choose
the Build Events property sheet. You can enter either / or a prebuild and
postbuild batch file there.
--Peter
"tshad" <ts***@dslextreme.comwrote in message
news:OW**************@TK2MSFTNGP05.phx.gbl...
>
"Peter Ritchie [C# MVP]" <PR****@newsgroups.nospamwrote in message
news:EB**********************************@microsof t.com...
>Generally what I do is add an app.config to the application (so the setup
can
see and deploy it). Then, I add several other application
configurations,
one for each scenario. For example, I'll have the main app.config,
dev.config and release.config.

Then, for each configuration I have a pre-build event that copies the
appropriate config on top of app.config. I then only edit only
dev.config or
release.config. This means the appropriate app.config exists in the bin
directory, plus it means when I build the setup the contents of the
release.config is used.
So do you have the 3 config files outside of the solution folders and then
copy (and rename them - ie "copy dev.config app.config")?

How do you do the pre-build event?

Thanks,

Tom
>--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"tshad" wrote:
>>I have a Windows Service that I am deploying by setting a Deployment
project
in my solution.

The problem I am having is with the app.config file. This where we
store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well
as a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom

Jun 27 '08 #5
The configs would still be in the solution so they can be version controlled,
etc.

You can add a pre-build event in the projects properties (right click the
project in the solution explorer and select Properties). In the project
Properties, select the Build Events tab. Enter any commands you want
executed before the build is executed in the "Pre-build event command line"
text box.

If you're dealing with version control, you'll want to add commands to
ensure app.config is not write-protected before copying (or during copy with
XCOPY /R).

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"tshad" wrote:
>
"Peter Ritchie [C# MVP]" <PR****@newsgroups.nospamwrote in message
news:EB**********************************@microsof t.com...
Generally what I do is add an app.config to the application (so the setup
can
see and deploy it). Then, I add several other application
configurations,
one for each scenario. For example, I'll have the main app.config,
dev.config and release.config.

Then, for each configuration I have a pre-build event that copies the
appropriate config on top of app.config. I then only edit only dev.config
or
release.config. This means the appropriate app.config exists in the bin
directory, plus it means when I build the setup the contents of the
release.config is used.
So do you have the 3 config files outside of the solution folders and then
copy (and rename them - ie "copy dev.config app.config")?

How do you do the pre-build event?

Thanks,

Tom
--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"tshad" wrote:
I have a Windows Service that I am deploying by setting a Deployment
project
in my solution.

The problem I am having is with the app.config file. This where we store
our connection string and folder locations.

My development app.config is different from my clients.

When I send him an msi file, I have to either add the clients app.config
file into my project in 2 locations (as I am running as an exe as well as
a
Service - which calls the code from the exe project) or send him the
app.config and have him replace it.

Is there a way to tell the deployment project to include a different
app.config file than is currently in the project.

Can you set up multiple build type (personalities) to run for testing?

Thanks,

Tom


Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: raghavendra | last post by:
Hi, How to run automatically windows service by using setup deployment insatllation script using visual studio 2003.? What i did is :-- 1. created a windows service & tested the same. 2....
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
0
by: yawnb | last post by:
I have a windows service written in C++ .NET. I am able to install it fine from the command prompt with "service.exe" -Install. I added a deployment project with a custom action and selected the...
2
by: russ.haley | last post by:
I have created a small windows service in C# that installs using the service installer classes and a deployment project. I have been able to install the service but the uninstallation does not...
4
by: Rob R. Ainscough | last post by:
The task is brain dead simple - Uninstall prior Windows Service and Install newer version of Windows Service Background: 1. My Windows Service written in .NET 1.1 and deployed via MSI (Windows...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
1
by: kirk.quinbar | last post by:
Have you ever used a .net deployment project to install a windows service? If so, then i ran into an issue recently that maybe you could shed some light on. I am sure I probably did something...
4
by: ochocki | last post by:
Hi, I've created a solution with a project of type "Windows Service" and deployment project for this service that creates installation package. I want to have more then one copy of this...
2
by: Mika M | last post by:
I'm doing Windows Service programming using C# 2005. My solution contains Windows Service project. Then I added Setup and Deployment project into the same solution. Both service- and Setup and...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.