小弟在利用三层架构构建网站,抽象工厂的部分代码如下:
private static readonly string path = ConfigurationManager.AppSettings["WebDAL"];static public NewsSystem.IDAL.INews CreateNews()
{
   string className = path + ".News";
   return (NewsSystem.IDAL.INews)Assembly.Load(path).CreateInstance(className);
}而Web.confiy文件中如下:
<appSettings>
  <add key="WebDAL" value="NewsSystem.SQLDAL"/>
</appSettings>在执行过程报如下错误:
用户代码未处理 System.Reflection.TargetInvocationException
  Message="调用的目标发生了异常。"
  Source="mscorlib"
  StackTrace:
       在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       在 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
       在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       在 System.Reflection.Assembly.CreateInstance(String typeName)
       在 NewsSystem.DALFactory.DataAccess.CreateNews() 位置 D:\CompanyLayout\天津新锐信息科技有限公司\NewsSystem\DALFactory\DataAccess.cs:行号 24
       在 NewsSystem.News.News..ctor() 位置 D:\CompanyLayout\天津新锐信息科技有限公司\NewsSystem\News\News.cs:行号 17
       在 Insert..ctor() 位置 d:\CompanyLayout\天津新锐信息科技有限公司\NewsSystem\Web\Insert.aspx.cs:行号 15
       在 ASP.insert_aspx..ctor() 位置 c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\web\7bd2442a\35e7b9b3\App_Web_sirj8c-u.0.cs:行号 0
       在 __ASP.FastObjectFactory_app_web_sirj8c_u.Create_ASP_insert_aspx() 位置 c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\web\7bd2442a\35e7b9b3\App_Web_sirj8c-u.4.cs:行号 0
       在 System.Web.Compilation.BuildResultCompiledType.CreateInstance()
       在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
       在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
       在 System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
       在 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       在 System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)请问各位大虾是怎么会事,小弟由于还是新手,还请大家多多帮忙,谢谢!