Skip to content

Instantly share code, notes, and snippets.

@terjetyl
Created March 13, 2012 14:42
Show Gist options
  • Save terjetyl/2029188 to your computer and use it in GitHub Desktop.
Save terjetyl/2029188 to your computer and use it in GitHub Desktop.
Get executing assembly path
static public string AssemblyLoadDirectory
{
get
{
string codeBase = Assembly.GetCallingAssembly().CodeBase;
var uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment