SCSF & ENTLIB3: DatabaseFactory.CreateDatabase error

Topics: Data Access Application Block
Apr 25, 2007 at 8:28 AM
I am trying to use the DAAB with no success.
Everytime I execute DatabaseFactory.CreateDatabase an exception is thrown. Here are the details of the message:

"Der Typeninitialisierer für Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory hat eine Ausnahme verursacht."

InnerException
{
"Die Datei oder Assembly Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)":"Microsoft.Practices.ObjectBuilder, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
}

My App.config:
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>

Can anyone give me suggestions on what to do?
Thanks much!
Apr 25, 2007 at 1:08 PM
Check to make sure you are referencing the following 3 assemblies in your application required by the DAAB:

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

Is the SCSF using Enterprise Library 3.0? If not, you are best off waiting for Enterprise Library 3.0 to be used by the SCSF. Some of the SCSF assemblies are probably bound to the the Enterprise Library 2.0 assemblies.

Regards,

Dave

_____________________________

David Hayden
Microsoft MVP C#
Apr 25, 2007 at 1:21 PM
Thanks for your quick answer!

All 3 assemblies are referred to. When installing SCSF I referred to Enterprise Library 3.0.

I had to state that ObjectBuilder is used in old version (1.0.51205.0)

Apr 25, 2007 at 1:35 PM
Unfortunately, just referencing the latest Enterprise Library 3.0 assemblies is probably not going to work.

It sounds like the SCSF is bound to the older version of ObjectBuilder and perhaps bound to some of the assemblies in Enterprise Library 2.0. Mixing and matching the assemblies will cause all kinds of errors. I would expect the new version of the SCSF being developed now is probably using ObjectBuilder 1.0.51206.0 and can be used to reference Enterprise Library 3.0 dll's.

You could of course always recompile the SCSF Source Code and generate new assemblies with references to the new version of ObjectBuilder. You would probably also have to update your App.config files to include the new versions. It can be a pain and you may be better off waiting for a new version of SCSF or asking the SCSF Team to come out with a maintenance release that supports the latest version of ObjectBuilder, etc.

Regards,

Dave

______________________________________

David Hayden
Microsoft MVP C#
Apr 25, 2007 at 2:42 PM
Thanks again!

I think I rather wait for next release of SCSF