Strong named COM Interop 
Author Message
 Strong named COM Interop

Hi,

I am developing a Serviced component in VB .net that uses 2 COM components.
To be able to use the COM components i figured out that i needed to run
TLBimp to manually create the interop files for them to be strong signed. I
have then referenced the interop.<DLL File>.dll in my project and i can
instantiate the object (I think, at least it looks like that since
intellisense works)

The objects i am working with is ActiveDS (ADSI) and MSIMLib (Exchange
messenger Admin).

The method i want to run in the MSIMLib object requires a ActiveDs.IadsUser
object as input, but even though i am able to create this object it is not
recogized by the MSIMLib method. Below is a snippet from my code

Dim oUser As ActiveDs.IADsUser
Dim oUserAdmin As New MSIMADMLib.IMUserAdmin

oUser = CType(GetObject("LDAP://" & UserDN), ActiveDs.IADsUser)
oUserIMAlias = oUserAdmin.UserEmailAlias(oUser)
oUserAdmin.EnableUser(CType(oUser, ActiveDs.IADsUser), oUserIMAlias,
"mail1.ipe-internal.com", CType(oIMVS, MSIMADMLib.IMVirtualServer))

The error occurs on line 5 and 6 in the ocde above where oUser is not
recognized as being of type ActiveDS.iAdsUser
and the error message that Visual Studio gives me is

 Reference required to assembly 'ActiveDs' containing the type
'ActiveDs.IADsUser'. Add one to your project.

This code works OK when executed in a normal Windows forms application,
where i don't have to create the interop files myself

Anyone experinced this before and can give me some hints on what to do ?

Regards

Niclas



Tue, 22 Nov 2005 22:27:17 GMT  
 Strong named COM Interop
OK,

managed to find a solution myself. If anyone is interested, I called the
output file from the tlbim ActiveDs.dll and then  registered both interop
files in the GAC and that made the trick.

Niclas


Quote:
> Hi,

> I am developing a Serviced component in VB .net that uses 2 COM
components.
> To be able to use the COM components i figured out that i needed to run
> TLBimp to manually create the interop files for them to be strong signed.
I
> have then referenced the interop.<DLL File>.dll in my project and i can
> instantiate the object (I think, at least it looks like that since
> intellisense works)

> The objects i am working with is ActiveDS (ADSI) and MSIMLib (Exchange
> messenger Admin).

> The method i want to run in the MSIMLib object requires a
ActiveDs.IadsUser
> object as input, but even though i am able to create this object it is not
> recogized by the MSIMLib method. Below is a snippet from my code

> Dim oUser As ActiveDs.IADsUser
> Dim oUserAdmin As New MSIMADMLib.IMUserAdmin

> oUser = CType(GetObject("LDAP://" & UserDN), ActiveDs.IADsUser)
> oUserIMAlias = oUserAdmin.UserEmailAlias(oUser)
> oUserAdmin.EnableUser(CType(oUser, ActiveDs.IADsUser), oUserIMAlias,
> "mail1.ipe-internal.com", CType(oIMVS, MSIMADMLib.IMVirtualServer))

> The error occurs on line 5 and 6 in the ocde above where oUser is not
> recognized as being of type ActiveDS.iAdsUser
> and the error message that Visual Studio gives me is

>  Reference required to assembly 'ActiveDs' containing the type
> 'ActiveDs.IADsUser'. Add one to your project.

> This code works OK when executed in a normal Windows forms application,
> where i don't have to create the interop files myself

> Anyone experinced this before and can give me some hints on what to do ?

> Regards

> Niclas



Wed, 23 Nov 2005 00:28:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Automation error referencing .net dll from com (com interop)

2. Strong Name Property

3. strong name key pair file location...

4. CASPOL and Strong Names

5. Strong Name Option

6. Issue - Microsoft.Word object library does not have a strong name

7. Strong named assemblies and recompiling

8. Strong Name Validation Failed

9. Theory Strong Name Evidence vs. Imperative Security

10. MSChart with Strong Name

11. Strong Name ??

12. strong names

 

 
Powered by phpBB® Forum Software