I'm using the following code to create a Berkeley DB but I'm receiving an error on the last line:
The type initializer for 'BerkeleyDB.Internal.libdb_csharpPINVOKE' threw an exception.
Code:
Dim DB As DatabaseEnvironment
Dim Config As DatabaseEnvironmentConfig
Config = New DatabaseEnvironmentConfig
Config.Create = True
DB = DatabaseEnvironment.Open("d:\database.db", Config)
Does anyone know what I am doing wrong please ?
I'm using VB Express 2010 with the .Net Framework 4.0
Full Stack :
System.TypeInitializationException: The type initializer for 'BerkeleyDB.Internal.libdb_csharpPINVOKE' threw an exception. --->
System.TypeInitializationException: The type initializer for 'SWIGStringHelper' threw an exception.
System.DllNotFoundException: Unable to load DLL 'libdb_csharp61': Le module spécifié est introuvable.
(Exception from HRESULT: 0x8007007E) at BerkeleyDB.Internal.libdb_csharpPINVOKE.SWIGStringHelper.SWIGRegisterStringCallback_libdb_csharp(SWIGStringDelegate stringDelegate)
at BerkeleyDB.Internal.libdb_csharpPINVOKE.SWIGStringHelper..cctor()
in C:\carol\db-6.1.23\lang\csharp\src\Internal\libdb_csharpPINVOKE.cs:line 29
--- End of inner exception stack trace ---
at BerkeleyDB.Internal.libdb_csharpPINVOKE.SWIGStringHelper..ctor()
at BerkeleyDB.Internal.libdb_csharpPINVOKE..cctor()
in C:\carol\db-6.1.23\lang\csharp\src\Internal\libdb_csharpPINVOKE.cs:line 33
--- End of inner exception stack trace ---
at BerkeleyDB.Internal.libdb_csharpPINVOKE.new_DB_ENV(UInt32 jarg1)
at BerkeleyDB.Internal.DB_ENV..ctor(UInt32 flags)
in C:\carol\db-6.1.23\lang\csharp\src\Internal\DB_ENV.cs:line 276
at BerkeleyDB.DatabaseEnvironment..ctor(UInt32 flags)
in C:\carol\db-6.1.23\lang\csharp\src\DatabaseEnvironment.cs:line 174
at BerkeleyDB.DatabaseEnvironment.Open(String home, DatabaseEnvironmentConfig cfg)
in C:\carol\db-6.1.23\lang\csharp\src\DatabaseEnvironment.cs:line 2705
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
in C:\Documents and Settings\Steven\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.vb:line 13"