我是靠谱客的博主 暴躁酒窝,这篇文章主要介绍“Could not load file or assembly'OracleDAL' or one of its dependencies. 系统找不到指定文件”解决方法,现在分享给大家,希望可以做个参考。

仿照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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(190)

评论列表共有 0 条评论

立即
投稿
返回
顶部