我是靠谱客的博主 暴躁酒窝,最近开发中收集的这篇文章主要介绍“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 not load file or assembly'OracleDAL' or one of its dependencies. 系统找不到指定文件”解决方法所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部