CSharp examples for System.Reflection:Assembly
Loads an assembly by given assembly name.
using System.Reflection; using System.Linq; using System.Collections.Generic; using System;/*from www. j a v a 2s. c om*/ public class Main{ /// <summary> /// Loads an assembly by given assembly name. /// </summary> /// <param name="assemblyName">The assembly name.</param> /// <returns>The loaded assembly.</returns> public static Assembly LoadAssembly(this string assemblyName) { if (assemblyName.IsNullOrWhiteSpace()) { throw new ArgumentException("The assembly name cannot be null, empty or white-space.", nameof(assemblyName)); } var assembly = Assembly.Load(new AssemblyName(assemblyName)); return assembly; } }