I need to the the bin path of the executing assembly. How do you get it? I have a folder Plugins in the Bin/Debug and I need to get the location
+3
A:
Here is how you get the execution path of the application:
path = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );
Kevin
2010-08-11 19:05:07
Hi,thanks for your prompt reply. Why is it that if I hardcode the path it finds it and if I do the following code it doesnt .The only difference I can see is the "\\" .Am I missing something? var binpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); var fullpath = Path.Combine(binpath, folderName); if (!Directory.Exists(fullpath)) return;
2010-08-11 19:16:46
A:
You could do this
Assembly ass = Assembly.GetExecutingAssembly();
string path = System.IO.Path.GetDirectoryName(ass.Location);
TooFat
2010-08-11 19:06:22
+1
A:
Path.GetDirectoryName(Application.ExecutablePath)
eg. value:
C:\Projects\ConsoleApplication1\bin\Debug
Turek
2010-08-11 19:24:18