Skip to content

Commit

Permalink
Added GetAssemblyLocalPath function in ReflectionUtility.
Browse files Browse the repository at this point in the history
  • Loading branch information
GregaMohorko authored Oct 20, 2017
1 parent ab63637 commit ebd1e20
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/GM.Utility/GM.Utility/ReflectionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ public static AssemblyInformation GetAssemblyInformation(Assembly assembly)
return new AssemblyInformation(title, description, company, product, copyright, trademark, version);
}

/// <summary>
/// Gets the local (operating-system wise) path of the assembly that defines the specified type.
/// </summary>
/// <param name="type">The type that is defined in the assembly of which to get the local path.</param>
public static string GetAssemblyLocalPath(Type type)
{
string codebase = type.Assembly.CodeBase;
var uri = new Uri(codebase, UriKind.Absolute);
return uri.LocalPath;
}

/// <summary>
/// Sets the specified property to the provided value in the provided object.
/// </summary>
Expand Down

0 comments on commit ebd1e20

Please sign in to comment.