Getting current assembly path

Posted on 1245820969|%e %b %Y, %H:%M %Z|agohover under c# code .net

Here is the small code snippet to get the current assembly path or full name:

/// <summary>
/// Returns the path (with ending backslash) of current executing assembly
/// </summary>
/// <returns>Path of executing assembly</returns>
public static string AssemblyPath () {
    return Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) +
        Path.DirectorySeparatorChar;
}
 
/// <summary>
/// Returns the full name including path, file name and extension of current executing assembly
/// </summary>
/// <returns>Full name of current executing assembly</returns>
public static string AssemblyFullName () {
    return Assembly.GetExecutingAssembly ().Location;
}
rating: 0+x
Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +