473,396 Members | 1,789 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,396 software developers and data experts.

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 4051
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.