473,398 Members | 2,120 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,398 software developers and data experts.

regarding the location of config files for the .net windows servic

hi all

i wrote a windows service.
i am trying to get it to use an app.config file.
unfortunately, when the service starts,
it assumes that the ConfigurationSettings file
is in C:\Windows\System32.

this is unacceptable to me.
rather, i would like the service to assume that the app.config file is in
the same directory as the .net windows service exe

can i do this?

Thanks

With Regards
Vinoth Kumar.V.K
Nov 17 '05 #1
2 2647
Hi,

As far as I was aware it alreadyu does this? I have written many
service applications using the app.config file and it has always
picked it up correctly from the directory that the EXE was running.
Not sure how it does this as you correctly state the service uses the
c:\windows\system32 as it's working directory as it runs wihtin the
svchost.

Have you tried an compile any example services from the net and see if
you get the same problem?

Cheers,

Erik

On Wed, 18 May 2005 23:27:43 -0700, Vinoth Kumar
<Vi*********@discussions.microsoft.com> wrote:
hi all

i wrote a windows service.
i am trying to get it to use an app.config file.
unfortunately, when the service starts,
it assumes that the ConfigurationSettings file
is in C:\Windows\System32.

this is unacceptable to me.
rather, i would like the service to assume that the app.config file is in
the same directory as the .net windows service exe

can i do this?

Thanks

With Regards
Vinoth Kumar.V.K


Nov 17 '05 #2
Thinking about it, it you wanted to try setting
Environment.Currentdirectory in your onstart event to your working
directory and see if that works?

On Wed, 18 May 2005 23:27:43 -0700, Vinoth Kumar
<Vi*********@discussions.microsoft.com> wrote:
hi all

i wrote a windows service.
i am trying to get it to use an app.config file.
unfortunately, when the service starts,
it assumes that the ConfigurationSettings file
is in C:\Windows\System32.

this is unacceptable to me.
rather, i would like the service to assume that the app.config file is in
the same directory as the .net windows service exe

can i do this?

Thanks

With Regards
Vinoth Kumar.V.K


Nov 17 '05 #3

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

Similar topics

8
by: Rim | last post by:
Hi, How can I control the location of the bytecode files? The reason I ask is I want to place the bytecode in a directory different than source code for backup reasons. Our backup system is...
2
by: Vincenzo Davi | last post by:
I have created a dll with several classes in C#. One of the classes references image files in the subdirectories of the bin/Release folder (basically where the dll resides). Now, I want to use...
5
by: localhost | last post by:
I want to determine within my code-behind only the location of the current tem directory for ym ASP.NET files. For example, the latest web app build on my system shows: ...
1
by: herbert | last post by:
In VS.2005 a Windows Service can have an app.config file. A class library can also have an app.config file. Now if my Windows Services uses three class libraries, each of it coming with its own...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
1
by: phrankbooth | last post by:
Hi, New to windows services, but I've managed to create one and install it successfully. However, I'm confused about what the InstallUtil actually does. I'm not sure if it just registers and...
1
by: n33470 | last post by:
Hi all, We have an asp.net 1.1 app that we're in the process of converting to 2.0. What I'm about to describe runs just great in the 1.1 framework, but does not work in the 2.0 framework. ...
1
by: Robert Dufour | last post by:
Changing a setting in the UserSettings from within my app using code (Vs2005 vb.net) does not seem to persist changes to the myapp.exe.config file what is the location and name of the file where...
8
by: Bill McCormick | last post by:
<!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.