Get Assembly Path - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Get Assembly Path

Demo Code

// Copyright (c) Microsoft Corporation. All rights reserved.
using System.Reflection;
using System;//from  w  w  w. j  av a2  s. c  om

public class Main{
        public static string GetAssemblyPath(this Assembly assembly) {
            var codeBase = assembly.CodeBase;
            return new Uri(codeBase).LocalPath;
        }
}

Related Tutorials