Hello
I think u can get the executable path using
AppDomain.CurrentDomain.BaseDirectory
Regards
Shrihari Devji
>I tried reading a file into an application running as a Windows Service,
>however it is not returning the correct location for the running
>executable. How do I determine the full path for this?
Sebastian Lopez - 06 Mar 2008 12:30 GMT
Hello,
AppDomain.CurrentDomain.BaseDirectory does not guaranty to return
assembly's path (although it will do it most of the cases).
BaseDirectory is used by the CRL to probe for assemblies and can be
configured when the AppDomain is created.
You can use the following code to get the path:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)
Sebastian
On Mar 6, 4:49 am, "Shrihari Devji" <srihari.de...@in.bosch.com>
wrote:
> Hello
>
[quoted text clipped - 8 lines]
> >however it is not returning the correct location for the running
> >executable. How do I determine the full path for this?