关于动态加载DLL
我参考的是PetShop的
string path = System.Configuration.ConfigurationSettings.AppSettings["WebDAL"];
string className = path + ".Account";
// Using the evidence given in the config file load the appropriate assembly and class
return (Test.IDAL.IAccount) Assembly.Load(path).CreateInstance(className);
返回的结果始终是null,请问是否需要设置web.config?我看PetShop的Web.Config设置的有以下内容:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<qualifyAssembly partialName="PetShop.SQLServerDAL" fullName="PetShop.SQLServerDAL,version=3.2.1.0,publicKeyToken=a7987b61c51ca872,culture=neutral" />
</assemblyBinding>
</runtime>
如果需要设的话,publicKeyToken这个值从何而来呢?