模仿petshop做三层
我的是数据库连接用的是这个俩个程序集
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;
web.config配置是:
  <configSections>
  <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null"/>
  </configSections>
  <dataConfiguration defaultDatabase= "SQLConnString " />
  <appSettings>
  <add key="WebDAL" value="SQLServerDAL"/>
  </appSettings>
SQLServerDAL的属性名称我已经核对过了。和这个value的值是一样的
反射生成的方法:
  public static Iwebpicmanager Createwebpicmanager()
  {
  string className = path + ".webpicmanager";
  return (Iwebpicmanager)Assembly.Load(path).CreateInstance(className);  }
这是报的错误:
System.IO.FileNotFoundException: 未能加载文件或程序集“SQLServerDAL”或它的某一个依赖项。系统找不到指定的文件
跟踪信息如下:
程序集加载跟踪: 下列信息有助于确定程序集“SQLServerDAL”无法加载的原因。
警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。 堆栈跟踪:  
[FileNotFoundException: 未能加载文件或程序集“SQLServerDAL”或它的某一个依赖项。系统找不到指定的文件。]
  System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
  System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +50
  System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
  System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
  System.Reflection.Assembly.Load(String assemblyString) +25
  DALFactory.DataAccess.Createwebpicmanager() in C:\Documents and Settings\Administrator\桌面\Bjdream\DALFactory\DataAccess.cs:134
  BLL.webpicmanager..cctor() in C:\Documents and Settings\Administrator\桌面\Bjdream\BLL\webpicmanager.cs:18[TypeInitializationException: “BLL.webpicmanager”的类型初始值设定项引发异常。]
  BLL.webpicmanager..ctor() +0
  bjdream_manager_main_webadd_flash..ctor() in c:\Documents and Settings\Administrator\桌面\Bjdream\Website\bjdream_manager\main\webadd_flash.aspx.cs:18
  ASP.bjdream_manager_main_webadd_flash_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website\cc4a0e4e\2871a021\App_Web_mkej10ro.24.cs:0
  __ASP.FastObjectFactory_app_web_mkej10ro.Create_ASP_bjdream_manager_main_webadd_flash_aspx() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website\cc4a0e4e\2871a021\App_Web_mkej10ro.98.cs:0
  System.Web.Compilation.BuildResultCompiledType.CreateInstance() +58
  System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +113
  System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +32
  System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +62
  System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +294
  System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +147
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +152 
希望能解决问题