Is there any difference between Interop.AZROLESLib and Microsoft.Interop.Security.AzRoles?

1.9k Views Asked by At

Microsoft provide the Microsoft.Interop.Security.AzRoles interop library in Server 2003 for AzMan (Authorization Manager). It was built under .NET 1.0.

Can anyone tell me if there's a difference between this and creating a reference to the "azroles 1.0 Types Library" (C:\Windows\system32\azroles.dll) which ends up as Interop.AZROLESLib? Apart from the namespace? And the fact that it would be created under the current version of .Net?

2

There are 2 best solutions below

1
On

INTEROP.AZROLESLIB.DLL is used by objects that are classified as safe.

Where as

Microsoft.Interop.Security.AzRoles is a authorization interoperability wrapper for methods and objects.

0
On

The main purpose of a commonly-provided Interop DLL (such as Microsoft.Interop.Security.AzRoles) is to make sure that type identifiers match when two independently-produced assemblies need to pass references to the underlying types to each other. In other words, if AssemblyA.dll needs to provide a collection of objects of type IComInterface (from ComComponent.dll) as a public property, and AssemblyB.exe needs to, in turn, pass one or more of those objects back to the ComComponent.dll, then you need a common Interop DLL. That's what Microsoft.Interop.Security.AzRoles.dll is for. When you add a reference from your project to AzRoles.dll, Visual Studio will build a new Interop.AzRoles.dll assembly for you that has identifiers unique to that assembly.

Bottom line is that you might not care about passing these references around, but there's not much point in creating your own Interop DLL (even if it is automatic) when there is already one made for you. Use the Microsoft.Interop.Security.AzRoles assembly). Also, while I don't see evidence of this for this assembly, an Interop assembly could, in theory, provide additional adapter-like functions that make the managed-unmanaged interop work better.