Created
October 24, 2016 21:40
-
-
Save constructor-igor/3b2c1d2a64cd1efd9097a7791deb5224 to your computer and use it in GitHub Desktop.
AssemblyDirectory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// http://stackoverflow.com/questions/52797/how-do-i-get-the-path-of-the-assembly-the-code-is-in | |
// | |
private static string AssemblyDirectory | |
{ | |
get | |
{ | |
string codeBase = Assembly.GetExecutingAssembly().CodeBase; | |
UriBuilder 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