Mono.Cecil.Inject.AssemblyLoader.LoadAssembly C# (CSharp) Method

LoadAssembly() public static method

Loads an assembly from the specified path.
public static LoadAssembly ( string path ) : AssemblyDefinition
path string Path to the assembly. Can be either relative (to the executing assembly directory) or absolute.
return AssemblyDefinition
        public static AssemblyDefinition LoadAssembly(string path)
        {
            AssemblyDefinition result;

            if (!File.Exists(path))
                throw new FileNotFoundException($"Missing DLL: {path}");
            using (Stream s = File.OpenRead(path))
            {
                result = AssemblyDefinition.ReadAssembly(s);
            }
            if (result == null)
                throw new NullReferenceException($"Failed to read assembly {path}");
            return result;
        }
    }
AssemblyLoader