Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies

 C#, VS2005, Webforms.

 **NOTE** This page loads fine when I "View in broswer" locally...but when I'm on our web server, below occurs

Yesterday when I left work, my web app worked fine.  Today, I get this error:

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.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.EnterpriseLibrary.Data, Version=3.1.0.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)

 No idea how to fix it or what was done.  I have google searched this for 3 hours now and have not netted a definitive answer.  I'm loosing my mind.

My Web.config has a reference to this in two spots: 

 

    <configSections>
        <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </configSections>

 and

<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
        <sources>
            <add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" filePath="entlib.config"/>
        </sources>
    </enterpriseLibrary.ConfigurationSource>

 Anyone have any idea how to fix this?  It's so odd that it worked perfectly yesterday but not today...and how it does run locally just fine, but not on the server (which makes it live on my .com).
 


http://www.nerdnology.com
0
corbybender
11/14/2007 3:58:58 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

10 Replies
10447 Views

Similar Articles

[PageSpeed] 30

This error means that ASP.NET was not able to find the EnterpriseLibrary dll. 

To fix it, try install Enterprise Library on the web server or upload the required dll into the bin folder.


Bruce
DiscountASP.NET: Developer Ready ASP.NET Web Hosting
- Microsoft Gold Certified Partner
- Voted 2008, 2007, 2006 & 2005 Best ASP.NET Web Hosting by asp.netPRO Magazine
0
Bruce
11/14/2007 7:41:52 PM

did you ever manage to fix this ?  I have the same problem, I DO have the required dll files in the bin folder yet I still get this error.  It started to happen after I ran the Enterprise library confguration tool to add caching to my application, the tool added these 2 lines

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

My app fails on the first line with this error message

An error occurred creating the configuration section handler for dataConfiguration:
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.  

 

0
misuk11
11/28/2007 2:37:36 PM

 Hey misuk11.  I didn't get it fixed and really am still unclear on what the heck happened.

 

What I did to work around this, though, was to use Code Smith to rebuild everything in a different directory on my C:\.  After that, I opened the project in VS 2005 from the new directory, built it, published the files out to the same location as before (after emptying the contents of my web directory on the web server) and then it worked fine.

 

My guess is that the public key token might be machine/directory/even time or date specific.  If anything changes, like creating things in a new directory, it resets something.

 *shrug*  I don't know, though.  Just building in a new directory seemed to fix things for me.  Hope this helps.

 

 


http://www.nerdnology.com
0
corbybender
11/28/2007 4:04:39 PM

Hi

I managed to fix the problem in the end.  It seems there were 2 copies of that particular dll on my system  (both the same version)

The enterprise library installer  installs into

C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\Bin

I also had an identical copy in a directory called C:\EntLib3Src\App Blocks\bin

I removed all references to the enterpise libray dll's in my application, then re added them as references making sure they all came from

C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\Bin

this seemed to work !

0
misuk11
11/28/2007 4:15:35 PM

That's just crazy.  lol.  But I'm glad you got it working again.  What I find odd is that I didn't mess at all (from my hazy recollection) with any DLL files on my web server.  I don't recall de-referencing and re-referencing any .dlls in my project....but maybe I did.  Anyway, I think your above post should help others in the future. 


http://www.nerdnology.com
0
corbybender
11/28/2007 4:27:35 PM

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

Instead of the above statement, use the below one

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data />

It started working for me without throwing the error message.

Hope it helps..

 

0
cimscims
12/19/2007 7:48:04 PM

Yea, try to remove and re-add the ones in your C:\ProgramFiles\...


When is Microsoft going to get rid of VB.NET!
0
dba123
3/24/2008 1:19:36 AM

A method to the madness:

 http://blogs.msdn.com/tomholl/archive/2007/04/19/avoiding-configuration-pitfalls-with-incompatible-copies-of-enterprise-library.aspx


This is the part where I politely request you to mark my response as the Answer, under the pretense that doing so will greatly help the community, blah, blah...
When in actuality I'm singlely intent upon the wopping 10 points that I'll receive!
... Oops, was that my outloud voice? ;)
0
tysonh28
4/15/2008 2:47:03 PM

Thanks, this one worked for me also!

I just had to add the Version, Culture and PublicKeyToken sections to web.config.

0
rglenn1
5/27/2008 8:49:18 PM

Tim Hollander's Blog solved lots of problem. I just took a print out and read each lines carefully. I did exactly what he wants to do. It is working perfectly. Thanks

http://blogs.msdn.com/tomholl/archive/2007/04/19/avoiding-configuration-pitfalls-with-incompatible-copies-of-enterprise-library.aspx

0
Zenthil
8/7/2008 8:36:51 PM
Reply: