System.TypeInitializationException: The type initializer for 'Zone.BLL.Admin_List' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Zone.AccessDAL' or one of its dependencies. The system cannot find the file specified. File name: 'Zone.AccessDAL' at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Zone.DALFactory.DataAccess.GreateAdmin_List() in E:\NetSite\OctaveZone\OctaveZone\DALFactory\DataAccess.cs:line 21 at Zone.BLL.Admin_List..cctor() in E:\NetSite\OctaveZone\OctaveZone\BLL\Admin_List.cs:line 14 === Pre-bind state information === LOG: User = CHARMJS-D9E93DE\charmjs LOG: DisplayName = Zone.AccessDAL (Partial) LOG: Appbase = file:///E:/NetSite/OctaveZone/OctaveZone/WEB/ LOG: Initial PrivatePath = E:\NetSite\OctaveZone\OctaveZone\WEB\bin Calling assembly : DALFactory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: E:\NetSite\OctaveZone\OctaveZone\WEB\web.config LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/web/1f446d36/9ef2fbce/Zone.AccessDAL.DLL. LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/web/1f446d36/9ef2fbce/Zone.AccessDAL/Zone.AccessDAL.DLL. LOG: Attempting download of new URL file:///E:/NetSite/OctaveZone/OctaveZone/WEB/bin/Zone.AccessDAL.DLL. LOG: Attempting download of new URL file:///E:/NetSite/OctaveZone/OctaveZone/WEB/bin/Zone.AccessDAL/Zone.AccessDAL.DLL. LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/web/1f446d36/9ef2fbce/Zone.AccessDAL.EXE. LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/web/1f446d36/9ef2fbce/Zone.AccessDAL/Zone.AccessDAL.EXE. LOG: Attempting download of new URL file:///E:/NetSite/OctaveZone/OctaveZone/WEB/bin/Zone.AccessDAL.EXE. LOG: Attempting download of new URL file:///E:/NetSite/OctaveZone/OctaveZone/WEB/bin/Zone.AccessDAL/Zone.AccessDAL.EXE. --- End of inner exception stack trace --- at Zone.BLL.Admin_List..ctor() at _UserUpdate_Login.Page_Load(Object sender, EventArgs e) in e:\NetSite\OctaveZone\OctaveZone\WEB\$UserUpdate\Login.aspx.cs:line 30
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://feiyun0112.cnblogs.com/
using System.Configuration;namespace Zone.DALFactory
{
public sealed class DataAccess
{
private static readonly string path = ConfigurationManager.AppSettings["WebDAL"]; public static IDAL.IAdmin_List GreateAdmin_List()
{
//string className = path + ".Admin_List";
//return (IDAL.IAdmin_List)Assembly.Load(path).CreateInstance(className);
//return new Zone.SQLServerDAL.Admin_List();
return new Zone.AccessDAL.Admin_List();
}
}
}
<appSettings>
web.config
<add key="SQLConnectionString" value="server=127.0.0.1;uid=sa;pwd=13780624317;database=Zone;"/>
<add key="WebDAL" value="Zone.SQLServerDAL"/>
</appSettings>