19 lines
534 B
C#
19 lines
534 B
C#
using System;
|
|
using System.Reflection;
|
|
|
|
namespace JD.Core
|
|
{
|
|
public static class AssemblyExtensions
|
|
{
|
|
/// <summary>
|
|
/// Returns the right location of the assembly even in a AssemblyExtensions scenario.
|
|
/// </summary>
|
|
public static string Location(this Assembly assembly)
|
|
{
|
|
var codeBase = assembly.CodeBase;
|
|
var builder = new UriBuilder(codeBase);
|
|
var path = Uri.UnescapeDataString(builder.Uri.LocalPath);
|
|
return path;
|
|
}
|
|
}
|
|
}
|