Re: Directory of assembly when using services
- From: "Michael Groeger" <google.news@xxxxxx>
- Date: Wed, 30 Nov 2005 10:58:23 +0100
Hi Arild,
thanks for your reply. I just tried
System.AppDomain.CurrentDomain.BaseDirectory. I found this solution in
log4net implementation because my logfile was written at the proper place,
but I did not use absolute paths in the configuration. It seems to work
fine, but whats the difference between your solution and my one?
Regards,
Michael
"Arild Bakken" <arildb_@xxxxxxxxxxx> schrieb im Newsbeitrag
news:#9mElFZ9FHA.340@xxxxxxxxxxxxxxxxxxxxxxx
> System.Reflection.Assembly.GetExecutingAssembly() returns the current
> assembly, and it has properties to get it's location (Codebase,
Location...)
>
>
> Arild
>
> "Michael Groeger" <google.news@xxxxxx> wrote in message
> news:e6sIYAZ9FHA.2176@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi all,
> >
> > normally, when starting a service the current directory
> > (System.Environment.CurrentDirectory) is the system directory of the
> > platform. The service itself can be started from another location e.g.
> > c:\foo\bar\myservice.exe . Is there a way to get the directory the
service
> > executable was started from, in my example c:\foo\bar\?
> >
> > Kind regards and thanks for your help in advance,
> > Michael
> >
> >
>
>
.
- References:
- Directory of assembly when using services
- From: Michael Groeger
- Re: Directory of assembly when using services
- From: Arild Bakken
- Directory of assembly when using services
- Prev by Date: Re: Detecting file changes just like Visual Studio
- Previous by thread: Re: Directory of assembly when using services
- Next by thread: Detecting file changes just like Visual Studio
- Index(es):
Relevant Pages
|