473,224 Members | 1,754 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,224 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 4044
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
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...

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.