juststeve
asked on
How do I know which assembly is which?
Working with the QuickStarts for the EnterpriseLibrary... I've used an existing project as a jumping off point for my project and want to use the Release version of the logging.dll instead of the debug version that was used by the original project. I've built the release version and have pointed all of my references to the path containing the new version but get this error when at runtime.
Message "An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.Enter priseLibra ry.Logging , Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I need guidance understanding the relationship between the config information and the project's referenced assemblies. Details on understanding where VS thinks it should find referenced DLLs.
Message "An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.Enter
I need guidance understanding the relationship between the config information and the project's referenced assemblies. Details on understanding where VS thinks it should find referenced DLLs.
But the error you have could e.g. by caused by not referencing the Microsoft.Practices.Enterp riseLibrar y.DataBase when you configure the logging block to use database logging...
You need to have dll references to,
Microsoft.Practices.Enterp riseLibrar y.Logging. dll
Microsoft.Practices.Enterp riseLibrar y.Logging. Configurat ion.dll
Microsoft.Practices.Enterp riseLibrar y.Logging. Configurat ion.Design .dll
Since logging configuration section in the web.config will need all of the above references in the run time.
Microsoft.Practices.Enterp
Microsoft.Practices.Enterp
Microsoft.Practices.Enterp
Since logging configuration section in the web.config will need all of the above references in the run time.
ASKER
*** Assembly Binder Log Entry (1/29/2008 @ 3:50:53 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\F ramework\v 2.0.50727\ mscorwks.d ll
Running under executable C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\ Debug\CMS_ WinForm.vs host.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = CHI01-019-21\Administrator
LOG: DisplayName = Microsoft.Practices.Enterp riseLibrar y.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/Projects/CMSwApp/bin/ Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\ Debug\CMS_ WinForm.vs host.exe.C onfig
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\F ramework\v 2.0.50727\ config\mac hine.confi g.
LOG: Post-policy reference: Microsoft.Practices.Enterp riseLibrar y.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/Projects/CMSwApp/bin/ Debug/Micr osoft.Prac tices.Ente rpriseLibr ary.Loggin g.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\ Debug\Micr osoft.Prac tices.Ente rpriseLibr ary.Loggin g.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.Practices.Enterp riseLibrar y.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\F
Running under executable C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = CHI01-019-21\Administrator
LOG: DisplayName = Microsoft.Practices.Enterp
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/Projects/CMSwApp/bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\F
LOG: Post-policy reference: Microsoft.Practices.Enterp
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/Projects/CMSwApp/bin/
LOG: Assembly download was successful. Attempting setup of file: C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CMSwApp\bin\
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.Practices.Enterp
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
You will see the lookup path in the pasted log:
LOG: GAC Lookup was unsuccessful.
so, first GAC
Then application path.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
Have you tried cleaning your solution and then rebuilding it?
If you linked to the 'source' version of the EL before, that version was not signed as far as I remember.
I believe the 3.1 version came with a signed set of dll's that gets copied into a seperate folder.
You can reference to these dll's instead.
LOG: GAC Lookup was unsuccessful.
so, first GAC
Then application path.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
Have you tried cleaning your solution and then rebuilding it?
If you linked to the 'source' version of the EL before, that version was not signed as far as I remember.
I believe the 3.1 version came with a signed set of dll's that gets copied into a seperate folder.
You can reference to these dll's instead.
Install enterprise library, it will install those assemblies to GAC.
http://www.microsoft.com/downloads/details.aspx?FamilyID=4c557c63-708f-4280-8f0c-637481c31718
http://www.microsoft.com/downloads/details.aspx?FamilyID=4c557c63-708f-4280-8f0c-637481c31718
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should add these assemblies to GAC or
Add these dll's in to your web project as dll references.
Microsoft.Practices.Enterp riseLibrar y.Logging. dll
Microsoft.Practices.Enterp riseLibrar y.Logging. Configurat ion.dll
Microsoft.Practices.Enterp riseLibrar y.Logging. Configurat ion.Design .dll
Add these dll's in to your web project as dll references.
Microsoft.Practices.Enterp
Microsoft.Practices.Enterp
Microsoft.Practices.Enterp
Visual studio cmd prompt -> fuslogvw
then enable the log (to screen, or file, what you prefer)
then run your app, and check the fuslog for errors.