Click here to Skip to main content
Rate this: bad
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 23:29pm
Edited 24-Sep-12 23:45pm
Mehdi Gholam267.2K
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
Please Sign up or sign in to vote.

Solution 1

you must include 2 assemblies:
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
0 OriginalGriff 445
1 Sergey Alexandrovich Kryukov 322
2 Maciej Los 275
3 CHill60 195
4 King Fisher 179
0 OriginalGriff 240
1 Maciej Los 95
2 Sascha Lefévre 85
3 King Fisher 70
4 F-ES Sitecore 55

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 25 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100