日期:2014-05-17  浏览次数:20973 次

未能加载文件或程序集“BLL”或它的某一个依赖项。系统找不到指定的文件
这是小弟对着参考书一字不漏写的BBS三层系统,但编译的时候出现如下错误.
这个项目引用了如下类,按书上WebUI是不用引用BLL类的,可能是因为有IBLL接口,但现在有下面的错误,而且我在WebUI再引用了一下BLL,也是出现同样错误,在这里请教一下大家,究竟是什么问题呢,困扰了我很久了.还有,命名空间应该没错,都检查过了.





“/BBS.WebUI”应用程序中的服务器错误。
未能加载文件或程序集“BLL”或它的某一个依赖项。系统找不到指定的文件。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.IO.FileNotFoundException: 未能加载文件或程序集“BLL”或它的某一个依赖项。系统找不到指定的文件。

源错误:


行 49:             {
行 50:                 CacheDependency fileDependency = new CacheDependency(HttpContext.Current.Server.MapPath("Web.Config"));
行 51:                 bllObject = System.Reflection.Assembly.Load(bllName).CreateInstance(fullClassName);
行 52:                 CacheAccess.SaveToCache(className, bllObject, fileDependency);
行 53:             }


源文件: C:\Users\KF\documents\visual studio 2010\Projects\BBS论坛\BBS.Factory\DependencyInjector.cs    行: 51

程序集加载跟踪: 下列信息有助于确定程序集“BLL”未能加载的原因。


警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。


堆栈跟踪:


[FileNotFoundException: 未能加载文件或程序集“BLL”或它的某一个依赖项。系统找不到指定的文件。]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
   System.Reflection.Assembly.Load(String assemblyString) +28
   BBS.Factory.DependencyInjector.GetBLLObject(String className) in C:\Users\K