首页 新闻 会员 周边

关于Could not load file or assembly 错误的问题

0
悬赏园豆:60 [已解决问题] 解决于 2009-03-26 17:07

搞了一下午。实在找不到哪里有问题。

错误提示:

Server Error in '/' Application.

Could not load file or assembly 'WebSite.Core.AccessDAL' or one of its dependencies. 系统找不到指定的文件。

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'WebSite.Core.AccessDAL' or one of its dependencies. 系统找不到指定的文件。

Source Error:

Line 13:         {
Line 14: string className = path + ".SiteConfig";
Line 15: return (WebSite.Core.IDAL.ISiteConfig)Assembly.Load(path).CreateInstance(className);
Line 16: }
Line 17: }

Source File: E:\Web\ChnValve\Site.Core\DALFactory\DataAccess.cs    Line: 15
上面:path值为:WebSite.Core.AccessDAL,下有一个siteconfig类
  这个文件确实存在的。。。就是不明白问题出在哪里了

问题补充: WebSite.Core是一个项目 文件夹: BLL(业务逻辑层) 文件 namespace WebSite.Core.BLL { public class SiteConfig { private static readonly ISiteConfig dal=WebSite.Core.DALFactory.DataAccess.CreateConfig(); /// <summary> /// 更新配置信息 /// </summary> /// <param name="info"></param> public void UpdateConfig(SiteConfigInfo info) { dal.UpdateConfig(info); } } IDAL(数据访问层接口) 代码: namespace WebSite.Core.IDAL { /// <summary> /// 站点配置数据访问层接品 /// </summary> public interface ISiteConfig { /// <summary> /// 更新配置接口 /// </summary> /// <param name="config"></param> void UpdateConfig(SiteConfigInfo config); /// <summary> /// 获取配置接口 /// </summary> /// <returns></returns> SiteConfigInfo GetConfig(int id); } } ACCESS数据访问层代码: namespace WebSite.Core.AccessDAL { public class SiteConfig:ISiteConfig { DbDataReader reader; /// <summary> /// 更新系统配置 /// </summary> /// <param name="info"></param> public void UpdateConfig(SiteConfigInfo info) { SiteConfigInfo siteConfig = new SiteConfigInfo(); string sqlText = "update site_config set siteName=@siteName,siteDomain=@siteDomain,siteMail=@siteMail,copyRight=@copyRight,newsTemplate=@newsTemplate,newsCatalogTemplate=@newsCatalogTemplate,newsSavePath=@newsSavePath,newsPageSize=@newsPageSize,productTemplate=@productTemplate,productCatalogTemplate=@productCataLogTemplate,productSavePath=@productSavePath,productPageSize=@productPageSize,messagePageSize=@messagePageSize,imageSavePath=@imageSavePath"; OleDbParameter[] parms ={ new OleDbParameter(&qu
沉默杨的主页 沉默杨 | 初学一级 | 园豆:6
提问于:2009-03-23 14:21
< >
分享
最佳答案
0

(WebSite.Core.IDAL.ISiteConfig)Assembly.Load(path).CreateInstance(className);..问题就在这。
CreateInstance(className);....为虚拟工厂中的一个方法..他是建立对象缓存的
..可能你的工厂类中,没有这个方法吧。.每个对应的接口WebSite.Core.IDAL.ISiteConfig..都在工厂里有个对应创建对象缓存的方法..看有没有。

邢少 | 专家六级 |园豆:10926 | 2009-03-23 18:17
其他回答(3)
0

看看是不是有些声明没有加!你给的代码有限!见谅!

子夜星辰 | 园豆:1613 (小虾三级) | 2009-03-23 14:25
0

恩,提示应该说的比较明确,按提示仔细查查。

生鱼片 | 园豆:5757 (大侠五级) | 2009-03-23 21:16
0

path

 

的路径不对

llj098 | 园豆:825 (小虾三级) | 2009-03-23 22:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册