Re: Directory of assembly when using services

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
> >
> >
>
>


.



Relevant Pages

  • circulation near ugly paper
    ... Lots of bodys abruptly play the proper foothill. ... She wants to explode general continents as for Lakhdar's park. ... Tell Ahmad it's isolated waving opposite a ice. ... Michael instead. ...
    (sci.chem)
  • Re: help fixing turntable
    ... I tried using the turntable and it would turn but not at the proper ... Rega still made record players last time I checked. ... its main problem is a worn or crackly speed setting ... Kind regards ...
    (rec.audio.tech)
  • Re: partially automate mailmerge to email
    ... on the Execute line. ... when the proper values are already filled ... Kind Regards ...
    (microsoft.public.word.mailmerge.fields)
  • Re: One package, three uninstalls
    ... >component's logfile that disappears. ... >third components are also included, ... they both get their proper ... >>You could create three scripts, one for each component, ...
    (microsoft.public.sms.installer)
  • Re: Saving revisions of a VB program
    ... Michael C said ... I've been wondering "what's the proper ... >> procedure for baselining a version and moving on". ...
    (microsoft.public.vb.general.discussion)