Full Local Path from Assembly - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Full Local Path from Assembly

Demo Code


using System.Reflection;
using System.Linq;
using System.IO;//  w  w w. ja v a2  s .  c  o m
using System;

public class Main{
        public static string FullLocalPath(this Assembly assembly)
    {
        var codeBase = assembly.CodeBase;
        var uri = new UriBuilder(codeBase);
        var root = Uri.UnescapeDataString(uri.Path);
        root = root.Replace("/", "\\");
        return root;
    }
}

Related Tutorials