The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception  
Author Message
Seth Livingston





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

Hi,

I got this error while working on Data Access Logic components using the Enterprise Library.

The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.

I searched everywhere and found nothing but some fragmented advice related to medium trust. The actual problem was that I had a reference to:

Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll

...but I also needed a reference to:

Microsoft.Practices.EnterpriseLibrary.ObjectBuilder.dll

Reflection is at work here, so the compiler didn't catch the missing reference. I thought I'd post here to hopefully save someone else the trouble.



.NET Development18  
 
 
lfarrell





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

Thank you for posting that. It was driving me crazy!

 
 
Jagdish Sakhiya





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

Thanks its helped me to solved my problem.


 
 
matti_c





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

thanks very much for the post.
 
 
snakehawk





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

thanks VERY MUCH for this POST

 
 
Atulsrivastava





PostPosted: .NET Framework Data Access and Storage, The type initializer for '...ObjectBuilder.EnterpriseLibraryFactory' threw an exception Top

Thanks dude for this..this really helped me. Smile