PC Review


Reply
Thread Tools Rate Thread

config file with a service

 
 
Sam Martin
Guest
Posts: n/a
 
      7th Feb 2005
just a quick one,

a colleague is writing a windows service, in c#. problem is the app.config
is only picked up when the service installs. i.e. subsequent changes to the
config file and then restart the service has no effect.

is this correct, app config settings are "set" on install and to change
them, you need to reinstall the service?

any ideas welcome.
tia
sam martin


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      7th Feb 2005
Sam,

No, this is not correct. Are you truly shutting down the service, or
are you only pausing it? The app config file is read when the CLR starts up
for the process. Also, are you sure that the app config file is set to the
name of your executable, and not the install executable?


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Sam Martin" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> just a quick one,
>
> a colleague is writing a windows service, in c#. problem is the
> app.config is only picked up when the service installs. i.e. subsequent
> changes to the config file and then restart the service has no effect.
>
> is this correct, app config settings are "set" on install and to change
> them, you need to reinstall the service?
>
> any ideas welcome.
> tia
> sam martin
>



 
Reply With Quote
 
Sam Martin
Guest
Posts: n/a
 
      7th Feb 2005
thanks nick, you're a star as ever. he's realised the error of his ways.

using a harness to test the onstart event of the service. the process isn't
oviously restarting, just the service in the process.

he says thanks

cheers
sam

"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Sam,
>
> No, this is not correct. Are you truly shutting down the service, or
> are you only pausing it? The app config file is read when the CLR starts
> up for the process. Also, are you sure that the app config file is set to
> the name of your executable, and not the install executable?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Sam Martin" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> just a quick one,
>>
>> a colleague is writing a windows service, in c#. problem is the
>> app.config is only picked up when the service installs. i.e. subsequent
>> changes to the config file and then restart the service has no effect.
>>
>> is this correct, app config settings are "set" on install and to change
>> them, you need to reinstall the service?
>>
>> any ideas welcome.
>> tia
>> sam martin
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Service config file Peter Microsoft C# .NET 14 24th Apr 2008 05:31 AM
Web service address in config file =?Utf-8?B?Q3JhaWcgSEI=?= Microsoft Dot NET Framework 2 3rd Oct 2006 08:59 AM
with service.exe.config file, I cannot start service scott Microsoft C# .NET 1 1st Aug 2006 07:41 AM
How to use an XML config file in Windows Service SP Microsoft C# .NET 5 10th Dec 2004 05:01 PM
Web service and config file =?Utf-8?B?S2V2?= Microsoft VB .NET 2 25th May 2004 07:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:33 AM.