août 27


a few time ago we were needing to update a website IIS' parameters to add some mime types.
In order to do that, we must use two COM components that you can find in %windir%\system32:

  • Active DS IIS Namespace Provider  (adsiis.dll)
  • Active DS Type Library                   (activeds.tlb)

We won't deal here how to add some mime types to IIS by code but how to create wrappers around these COM DLLs to be able to use them in .NET.
Of course, you all know that we can just "Add a new reference" to our project to let Visual Studio create these wrappers for us.
Article finished.

Not completely. Indeed if you do that and that you compile, you will see  bunch of warnings (40 in fact) like for example :
      The type library importer could not convert the signature for the member 'ADS_OCTET_STRING.lpValue'.
      The type library importer could not convert the signature for the member '__MIDL___MIDL_itf_ads_0000_0002.lpValue'.
      The type library importer could not convert the signature for the member 'ADS_NT_SECURITY_DESCRIPTOR.lpValue'.

If you are like me, no warning is acceptable in a project and so we have to do it differently. Of course in this case, there is no way for us to correct these warnings, but maybe we can hide them by creating the COM wrapper ourselves
To achieve this, we will use "tlbimp.exe" which is located in "%programfiles%/Microsoft Visual Studio 8/SDK/v2.0/bin" or in the corresponding folder depending of which version of Visual Studio you use.
To simplify our command lines, we'll update the %path% environment variable to include the tlbimp path, and we'll run a command prompt into "%windir%\system32".

Step 1 : Generate the ActiveDs.dll
As this DLL is referenced by adsiis.dll, we'll start by this one. Note that we want to specify that we are not interested by any warning

      tlbimp activeds.tlb /out:c:\temp\Interop.ActiveDs.dll /silent
Note that this command line use the type library file (activeds.tlb) to generate the DLL. We'll generate it in the temp directory and we'll keep the name that is normally generated by Visual Studio

Step 2 : Generate the AdsIis.dll

In this case, we'll specify that it references "Interop.ActiveDs.dll" and we'll also specify the main namespace of the DLL. We have chosen the namespace that is generated by Visual Studio.

      tlbimp adsiis.dll /out:c:\temp\Interop.IISOle.dll 
                           /reference:c:\temp\Interop.ActiveDs.dll /namespace:IISOle

Step 3 : Use the DLLs

Now you have two valid DLLs that can be used by any .NET project. And due to the "/silent" flag used in Step 1, no more warning is shown in Visual Studio.

Experts, do you know another way to achieve to the same result ? But maybe without using a command line ?



William Olson

Posted on samedi, 5 avril 2008 01:35

This was EXCELLENT.  Thank you.  Yes, I hate the warnings, too.  More importantly, I love the step-by-step walk though that you provided.  I have been in development for over 20 years, but you just cannot know everything and this helped.


Posted on mercredi, 28 mai 2008 22:10

THANK YOU for this very helpful tip.


Posted on vendredi, 18 décembre 2009 22:29

Great tech info, that really helped me. Thanks for sharing!


Posted on mercredi, 21 août 2013 00:55

It's really a great and helpful piece of information. I am satisfied that you shared this useful info with us. Please stay us informed like this. Thanks for sharing.

Also visit my website ... impotencia apio ( Susannah - )

auto finance

Posted on mercredi, 21 août 2013 16:19

Can I simply say what a relief to uncover somebody that genuinely understands what they are talking about on the internet. You actually realize how to bring an issue to light and make it important. More people have to look at this and understand this side of the story. It's surprising you are not more popular given that you definitely have the gift.

my blog;  auto finance -

Ajouter un commentaire

  • Commentaire
  • Aperçu immédiat