Click here to Skip to main content
15,610,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
System.TypeInitializationException: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=eca617d3969190ef' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory..cctor()
   --- End of inner exception stack trace ---
Updated 24-Sep-12 22:45pm
Richard MacCutchan 25-Sep-12 4:44am    
The message tells what is missing, so you need to figure out why this assembly does not exist. Are you trying to run a .NET 4 program on a system which only has .NET 3.5 or earlier?
rotenda 25-Sep-12 4:58am    
Im running .Net 4
Richard MacCutchan 25-Sep-12 5:11am    
Well you still have some assembly or file (Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0) missing from your system so you need to investigate why you are trying to use it and why it cannot be found.
Richard MacCutchan 25-Sep-12 5:13am    
According to MSDN this namespace is no longer maintained.
rotenda 25-Sep-12 6:19am    
After reading the link above i decided to remove it.

1 solution


you must include 2 assemblies:

Share this answer
rotenda 25-Sep-12 8:57am    
I have added the two assemblies, but getting error:
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900