Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 ---
Posted 24-Sep-12 22:29pm
rotenda275
Edited 24-Sep-12 22:45pm
Mehdi Gholam222.2K
v2
Comments
Richard MacCutchan at 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 at 25-Sep-12 4:58am
   
Im running .Net 4
Richard MacCutchan at 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 at 25-Sep-12 5:13am
   
According to MSDN this namespace is no longer maintained.
rotenda at 25-Sep-12 6:19am
   
After reading the link above i decided to remove it.
rotenda at 25-Sep-12 6:20am
   
but now the error is:The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception
Richard MacCutchan at 25-Sep-12 11:36am
   
Go and look at the exception to see what it is telling you. Learning to use the information from exceptions is an essential part of development and debugging.
Umer Aziz Malik at 25-Sep-12 5:20am
   
What exactly are you trying to do here?
rotenda at 25-Sep-12 6:20am
   
error: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
you must include 2 assemblies:
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Data
 
Regards
Robert
  Permalink  
Comments
rotenda at 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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 576
1 OriginalGriff 183
2 Tadit Dash 170
3 Sergey Alexandrovich Kryukov 156
4 Peter Leow 130
0 Sergey Alexandrovich Kryukov 9,325
1 OriginalGriff 5,473
2 Peter Leow 4,150
3 Maciej Los 3,540
4 Abhinav S 3,333


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid