4
I have a Console Application that performs connection with the SQL
. On other machines the application is working normally, but has one that has the version Windows Server Enterprise SP2
who is returning the following exception:
System.Runtime.Interopservices.Comexception (0x80040154): Failure in the Factory recovery of component COM classes with CLSID {443DDD3-7E78-44C6-865C-7984C9D2B08A} due to the following error: 80040154 Unregistered class (HRESULT exception: 0x80040154 (REGDB_E_CLASSNOTREG)). in System.RuntimeTypeHandle.Createinstance(Runtimetype type, Boolean publicOnly, Boolean noCheck, Boolean & canBeCached, Runtimemethodhandleinternal& ctor, Boolean& bNeedSecurityCheck)
The application is being compiled to X86
, which is the version of S.O
and .Net 4.5.2
that is installed on the server, as illustrated in the image below:
When trying to register the class System.Data.dll
with the regsvr32
you have the following output:
The "System.Data.dll" module was loaded, but the entry point was not found. n nCertifies that "System.Data.dll" is a valid DLL or file OCX and try again
Connection code
var cnx = ""DATA SOURCE=IPSERVER;INITIAL CATALOG=DBNAME; INTEGRATED SECURITY=FALSE;USER ID=USERID;PASSWORD=PASSWDUSER;MULTIPLEACTIVERESULTSETS=TRUE; POOLING=FALSE";";
var conn = new SqlConnection(cnx);
conn.Open();
System.Data.dll is an Assembly of the Framework, you should not register using
regsvr32
. With the Framework installed it will be accessible. Have you searched the registry for the CLSID entry of the error message? As you said your OS is 32bits (x86), the chvae should probably be in HKEY_CLASSES_ROOT CLSID{443DDDD3-7E78-44C6-865C-7984C9D2B08A}– Ricardo Pontual
Better repair the installation of . net: https://docs.microsoft.com/pt-br/dotnet/framework/install/repair and remember to turn off all non-essential Windows services
– Marcelo Shiniti Uchimura