This project is read-only.
1

Closed

Can not create object of SqlDatabase

description

Hi ,
 
I am using EntLib 5 for creating SqlDatabase object. I used strong named assemblies with certian Public Key.
 
Error:
The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Data.Database' threw an exception.
"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)":"Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null"
 
Previsously in GAC there were 4.1.0.0 DLL of EntLib 4 due to installation of Microsoft ESB Toolkit 2.0 which are not uninstalling directly. I uninstalled every DLLs of version 4.1.0.0 which gives me error that access denied due to some dependency, so i forcefully deleted that DDLs through RegEdit and GAC_MSIL.
 
So i uninstalled USB properly through control panel, then I removed ESB databases, ESB folder from Program files(x86), forcefully removed ESB assemblies same as above.
 
And added following DLLs to GAC and in the project references.
  1. Microsoft.Practices.EnterpriseLibrary.Common.dll (Version - 5.0.414.0, Public key - 88c53284f174dd3d)
  2. Microsoft.Practices.EnterpriseLibrary.Data.dll (Version - 5.0.414.0, Public key - 88c53284f174dd3d)
     
    Still the error persists.
     
    Please help me on this.
Closed Apr 11, 2013 at 7:23 PM by aoakleypnp
This is for the previous guidance, so it will be closed.

comments

akishaha wrote Jan 24, 2011 at 11:30 AM

Its working fine on machines.

akishaha wrote Jan 24, 2011 at 11:32 AM

Sorry other machines which dont have ESB and Enterprise Library on them.
They just GACed these 2 DLLs and working fine.

But problem is on my machine only.

Urgent help needed.

akishaha wrote Jan 24, 2011 at 11:35 AM

SqlDatabase expected = new SqlDatabase(connectionString); ---- Error as mentioned

wrote Jan 24, 2011 at 11:40 AM

wrote Feb 14, 2013 at 2:00 AM

wrote Apr 11, 2013 at 7:23 PM

wrote May 16, 2013 at 10:13 AM