I got this error, what does it mean ?

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hi all,

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

Thanks
Andrew
 
Andrew said:
Error Message:
" The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.
Configuration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception. "

Do you have access to the exception object rather than just the
message? That will probably tell you *which* exception was thrown by
the type initializer, which would explain what's wrong.
 
{System.TypeInitializationException: The type initializer for

'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception. --->

System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,

Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.
File name: 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null'
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory..cctor()

=== Pre-bind state information ===

LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).

file:///C:/Projects/ABC/WindowsTest1/bin/Debug/Microsoft.Practices.ObjectBuilder.DLL.
LOG: Attempting download of new URL

file:///C:/Projects/ABC/WindowsTest1/bin/Debug/Microsoft.Practices.ObjectBuilder/Microsoft.Practices.ObjectBuilder.D

LL.
LOG: Attempting download of new URL

file:///C:/Projects/ABC/WindowsTest1/bin/Debug/Microsoft.Practices.ObjectBuilder.EXE.
LOG: Attempting download of new URL

file:///C:/Projects/ABC/WindowsTest1/bin/Debug/Microsoft.Practices.ObjectBuilder/Microsoft.Practices.ObjectBuilder.E

XE.

--- End of inner exception stack trace ---
at

Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IConfigurationSo

urce configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.Create()
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer()
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log)
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object
message, ICollection`1 categories, Int32 priority,

Int32 eventId, TraceEventType severity, String title, IDictionary`2
properties)
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object
message)
at MQLImport.MQLImport.CreateImportFile(String LinkName)
at DoncasterPathImport.DBNTConverter.Convert(String message) in
C:\Projects\ABC\Converter.cs:line 106}
 
Andrew said:
{System.TypeInitializationException: The type initializer for

'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.
ObjectBuilder.EnterpriseLibraryFactory' threw an exception. --->

System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,

Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.
File name: 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null'
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.
ObjectBuilder.EnterpriseLibraryFactory..cctor()

And is Microsoft.Practices.ObjectBuilder.dll in the right place?
 
Thanks for replying.

I've got C# 6 projects in my 1 WinApp solution. They all link to the same
Microsoft.Practices.EnterpriseLibrary.Common.dll file , situated in the 1st
project's Debug folder.

Do I have to put the separate .dll files into their respective folders,
meaning in each one of my 6 project "Debug" folders ?

Thanks
Andrew
 
Andrew said:
I've got C# 6 projects in my 1 WinApp solution. They all link to the same
Microsoft.Practices.EnterpriseLibrary.Common.dll file , situated in the 1st
project's Debug folder.

Do I have to put the separate .dll files into their respective folders,
meaning in each one of my 6 project "Debug" folders ?

No, but it looks like you should also add a reference to
Microsoft.Practices.ObjectBuilder.dll.
 
Hi,
Thanks for your reply.

I do have a dll file named :
Microsoft.Practices.EnterpriseLibrary.Common.dll;

And which my code reads :
using Microsoft.Practices.EnterpriseLibrary.Common;
using
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder;

This means that I have already referenced the required .dll file ?

Thanks
Andrew
 
Andrew said:
I do have a dll file named :
Microsoft.Practices.EnterpriseLibrary.Common.dll;

And which my code reads :
using Microsoft.Practices.EnterpriseLibrary.Common;
using
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder;

This means that I have already referenced the required .dll file ?

No. Look at the error message - it's looking for
Microsoft.Practices.ObjectBuilder.dll. I don't know anything about the
library, but apparently it needs that DLL...

Note that using directives talk about namespaces, not assemblies - the
using directives you have in your file don't add references to
assemblies, so they're effectively irrelevant. It's the project
references which matter.
 
I've installed the "Microsoft Enterprise Library January 2006" edition and
I've found the ObjectBuider.dll there.
Finally... onto the next bug...

Thanks

regards,
Andrew
 
I've installed the "Microsoft Enterprise Library January 2006" edition and
I've found the ObjectBuider.dll there.
Finally... onto the next bug...

Thanks

regards,
Andrew
 
Back
Top