示例#1
0
        public static T CreateInstanceFromFile <T>(string filePath, string classNameWithNameSpace)
        {
            var ass = Assembly.LoadFile(filePath);

            if (ass == null)
            {
                return(default(T));
            }
            var instance = ass.CreateInstance(classNameWithNameSpace);

            if (ValidateHelper.Is <T>(instance))
            {
                return((T)instance);
            }
            return(default(T));
        }