2013-06-05 74 views
2

我正在使用第三方dll。 Interop.CRYPTLib。我想在我的.NET应用程序中使用它,但我得到这个错误无法在我的visual studio项目中使用我的interop dll

"Retrieving the COM class factory for component with CLSID {AF6AF735-6D30-4E16-8AFA-FD4317E87D1B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))." 

我尝试使用REGSVR32,但现在我得到这个错误

The module was loaded but the entry-point dllregisterserver was not found 

我用regasm它说注册类型成功但它仍然无法与第一个错误,但是当我使用/tlb:Interop.cryptlib.tlb我得到的错误

Interop.CRYPTLib.dll' was imported from a type library and cannot be re-exported to a type library. Make sure the type library from 
which the assembly was imported is registered. 

我的代码是

var s = new CRYPTLib.EncryptDecryptClass(); 
+1

确保所有涉及的部分具有相同的位数。如果您运行的是64位'regsvr32',但运行的是32位应用程序,反之亦然,则COM将不会看到注册信息。 –

+0

我尝试了两个。注册为32和64 – David

回答

2

Interop.CRYPTLib不是COM DLL - 它只是CRYPTLib COM DLL的.NET包装器。您需要实现CRYPTLib(可能是CRYPTLib.dll)的DLL,并使用regsvr32安装该DLL。

+0

您好我没有CRYPTLib.dll在我的项目或在bin目录中。这是一个常用的DLL吗?有没有办法让我使用Interop.cryptlib? – David

+0

@大卫 - 我从来没有听说过它。生成Interop.CRYPTLib.dll的人必须拥有它。如果可以,请与他们联系。 – shf301

+0

你是对的我设法找到正确的DLL注册。我很想知道互操作的目的。类 – David

相关问题