Modify Enterprise Library 4.0

Topics: Building and extending application blocks, Data Access Application Block, General discussion
Oct 28, 2008 at 4:10 PM
I need modify the source code of the Enterprise Library 4.0 because a want add new functionality for my Application. I open the code in Visual Studio 2008 and modify it. I built the solution with changes to generate the new ddl files, I copy and change the references with the new ddl's, then I rebuilt and execute my application and appears the follow error:

The assembly with display name 'Microsoft.Practices.EnterpriseLibrary.Data' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Practices.EnterpriseLibrary.Data, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.  

I using only two references: Microsoft.Practices.EnterpriseLibrary.Data and Microsoft.Practices.EnterpriseLibrary.Common
I implemented " Using Visual Studio to Strong Name Enterprise Library Assemblies" following steps shown in this page
Also i execute the .bat files (BuildLibraryAndCopyAssemblies) into the folder Scripts into the folder that contains source code to built and generate the solution of the Enterprise Library to create into the bin the dll's. But the error continue.
I need to know whats steps to follow to solve this problem.
Oct 28, 2008 at 6:41 PM
If you rebuilt Entlib, your binaries do not have a public key token. You need to edit your config file to change




Oct 28, 2008 at 6:46 PM
It sounds like you have signed the modified sources with your own key. In that case, you will have to do what ctavares said, but set PublicKeyToken=<your public key token>