dynamic与反射的性能比较,请参考:
http://www.cnblogs.com/cuitsl/archive/2012/01/06/2314636.html
代码如下:
string cacheInstance = ConfigurationManager.AppSettings["cachedll"]; var assembly = Assembly.Load(cacheInstance); dynamic instance = assembly.CreateInstance(ConfigurationManager.AppSettings["cachecls"]); return (ICache)instance;