473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Determine application directory in a Windows Service

I need to programatically determine the directory that the application/service is running from. If I use
Environment.CurrentDirectory it returns the System32 directory. Is there anyway to get this the correct directory?

Jul 21 '05 #1
3 4056
Request.ApplicationPath

Ibrahim ULUDAG
www.ibrahimuludag.com
--
"Buddy Ackerman" <bu**********@buddyackerman.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...
I need to programatically determine the directory that the
application/service is running from. If I use Environment.CurrentDirectory
it returns the System32 directory. Is there anyway to get this the correct
directory?

Jul 21 '05 #2
Request.ApplicationPath

Ibrahim ULUDAG
www.ibrahimuludag.com
--
"Buddy Ackerman" <bu**********@buddyackerman.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...
I need to programatically determine the directory that the
application/service is running from. If I use Environment.CurrentDirectory
it returns the System32 directory. Is there anyway to get this the correct
directory?

Jul 21 '05 #3
Try:
System.Reflection.Assembly.GetExecutingAssembly(). CodeBase
or
System.Reflection.Assembly.GetExecutingAssembly(). Location

whichever you prefer for your situation. That will tell you where your
..NET service executable is.
Buddy Ackerman wrote:
I need to programatically determine the directory that the
application/service is running from. If I use
Environment.CurrentDirectory it returns the System32 directory. Is
there anyway to get this the correct directory?

Jul 21 '05 #4

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

Similar topics

1
by: seppuku | last post by:
Hello! I wrote a service application, which fills a exported class from a dll with data from a access database and sends this filled class in a loop to a server. First, I linked the dll...
3
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of...
1
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
9
by: Wayne Wengert | last post by:
I built an ASP application and it runs fine on my local IIS. I am trying to move the application to my web service (ISP) out on the internet. I've read several of the help articles but they all...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
2
by: Buddy Ackerman | last post by:
I need to programatically determine the directory that the application/service is running from. If I use Environment.CurrentDirectory it returns the System32 directory. Is there anyway to get this...
4
by: casper | last post by:
Hi, I created an asp.net 2.0 website with VWD and made it an application in IIS. It was created on a ntfs disc (my documents...). The directory permissions are set on 'anonymous allowed' using...
7
by: Bolwerk | last post by:
Hello I got a client who uses what appears to be ASP.NET 2.0. I come from a UNIX/PHP/Apache background, and I'm not too familiar with ASP.NET. He had some permissions problem a few weeks ago...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.