概述
仿照petshop制作网站,网站分为WEB,BLL,IDAL,DALFactory,OracleDAL,Model。
在运行时出现DALFactory中的cs文件报错,cs文件内容如下:
public sealed class DataAccess
{
private static string path="OracleDAL";
public static IDAL.IConfig CreateConfig()
{
string className=path+ ".Config";
return (IDAL.IConfig)Assembly.Load(path).CreateInstance(className);
}
}
报错说“Could not load file or assembly'OracleDAL' or one of its dependencies. 系统找不到指定文件”
解决方法:
1.检查OracleDAL工程属性看Assembly name是否为OracleDAL。
2.看web中有没有添加OracleDAL.dll的引用(多数可能是这个原因)。
如果OracleDAL中的类没有应用接口会出现如下错误:
“Unable to cast object of type 'OracleDAL.Config' to type 'IDAL.IConfig'”
解决方法:OracleDAL中的类应该如定义:
public class Config:IConfig{}
最后
以上就是暴躁酒窝为你收集整理的“Could not load file or assembly'OracleDAL' or one of its dependencies. 系统找不到指定文件”解决方法的全部内容,希望文章能够帮你解决“Could not load file or assembly'OracleDAL' or one of its dependencies. 系统找不到指定文件”解决方法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复