ASP.NET & Data App Block EntLib 3.1 (May'07) Error

Topics: Building and extending application blocks, Data Access Application Block, Enterprise Library Core, General discussion
Feb 4, 2008 at 8:57 PM
I've had a time trying to get this configured and working. I was able to work past several issues/errors on my own, but now I don't seem to be able to get a handle on this error... can anyone suggest some tips? I am using ASP.NET 2.0 and I compiled the Enterprise Library 3.1 on my own and I don't think I am signing the newly compiled assembly... do I need to do this? Thanks for all of your help!! Oh, and I found ObjectBuilder source and compiled that as well, then compppiled the entlib with that. I also compiled the apps to allow partial trust code access.. .anything that I am missing... error below - thanks again.

Server Error in '/Site' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
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.FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.


=== Pre-bind state information ===
LOG: User = WGAWEST\troy
LOG: DisplayName = Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Temp/ml/Site/
LOG: Initial PrivatePath = C:\Temp\ml\Site\bin
Calling assembly : Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Temp\ml\Site\web.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/site/f78f5f05/ec5c7b65/Microsoft.Practices.ObjectBuilder.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/site/f78f5f05/ec5c7b65/Microsoft.Practices.ObjectBuilder/Microsoft.Practices.ObjectBuilder.DLL.
LOG: Attempting download of new URL file:///C:/Temp/ml/Site/bin/Microsoft.Practices.ObjectBuilder.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.



Stack Trace:


FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory..cctor() +0

TypeInitializationException: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IConfigurationSource configurationSource) +0
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.CreateDefault() +96
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase() +90
NCI.EasyObjects.EasyObject.GetDatabase() +240
NCI.EasyObjects.DynamicQuery.Load(String conjunction) +142
NCI.EasyObjects.DynamicQuery.Load() +50
Default.Page_Load(Object sender, EventArgs e) +303
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Nov 10, 2008 at 2:30 PM
You can download the compiled enterprise library 3.1 dlls for partial trust

http://rapidshare.de/files/40877380/Microsoft_Enterprise_Lib_3.1_-_Partial_Trust_-_Compiled_DLsL.zip.html