Hello,
I would like to locate the bin directory of the executing assembly of an ASP.NET web service during runtime. Normally, with console and windows applications, I could simply use
However, when debugging my web service, I noticed that this gives me a temporary directory that does not match my bin directory (since it's a web service) and it also does not include the external files that were imported into the solution (GnuPG's gpg.exe file and its subdirectories, for example). Could someone provide me with a snippet of code to determine the location of the bin directory, in order that I can access the executable file within the bin directory?
Thanks for your time.
Nick Ruiz
I would like to locate the bin directory of the executing assembly of an ASP.NET web service during runtime. Normally, with console and windows applications, I could simply use
Code:
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location)
However, when debugging my web service, I noticed that this gives me a temporary directory that does not match my bin directory (since it's a web service) and it also does not include the external files that were imported into the solution (GnuPG's gpg.exe file and its subdirectories, for example). Could someone provide me with a snippet of code to determine the location of the bin directory, in order that I can access the executable file within the bin directory?
Thanks for your time.
Nick Ruiz