JSFiddle - React, Tailwind, and code Playground

by ktabarez

JavaScript

public class FileExtensions
 {
  public static T CreateInstance<T>(this Filfe dllFile) : where T new()
  {
   if(!dllFile.Exists())
    throw new Exception(String.Format("Dll doesn't exist: {0}", dllFile.FullName));
   
   Assembly assembly = Assembly.LoadFrom(dllFile.FullName());
   
   Type type = assembly.GetType(typeof(T).Name);
   
   T obj = Activator.CreateInstance(type);
   
   return obj;
  }
}