1

I have a ASP.NET project running on IIS7. I just adding Microsoft.Practices.EnterpriseLibrary.Common.dll, Microsoft.Practices.EnterpriseLibrary.Data.dll, & Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll.

I am receiving this error:

Error   2   Could not load file or assembly 'Microsoft_Practices_EnterpriseLibrary_Common' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)       

I researched the issue and found this means that the dll is not in the right location but it is in my projectdirectory/bin folder. So I do not understand where else it should be referenced. It isn't referenced in my Web.config but assemblies tag was not generated in the project template.

Do I need to reference these assemblies? If so, where do I find the necessary attributes i.e. PublicToken, etc.?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
ExceptionLimeCat
  • 6,191
  • 6
  • 44
  • 77
  • If you are trying to add dll into the project, right click the solution-> add reference. If you are deploying your website, copy the dll to the ./bin folder. – Tianyun Ling Apr 19 '13 at 01:23
  • possible duplicate http://stackoverflow.com/questions/1110843/installing-microsoft-enterprise-libraries-and-databasefactory – Mustafa Ekici Apr 19 '13 at 01:41

3 Answers3

0

Sometimes this problem occurs with other tools/frameworks as well. Without pulling your hair out, just add a reference to the missing assembly and make sure to set those references to "Copy Local" = true. I notice with framework APIs that are placed in the GAC tend to have this issue.

code5
  • 4,434
  • 2
  • 31
  • 24
0

If its a "web site" project you can just throw the dlls in the bin folder. However if its a "web application" project, you'll need to add a reference and set copy local=true.

kman
  • 2,184
  • 3
  • 23
  • 42
0

I have corrected the issue. I'm not sure why but I had to create a new folder in my project and moved the dll's there and I was able to build the solution. This is a web site project.

ExceptionLimeCat
  • 6,191
  • 6
  • 44
  • 77