Back to Moq

Moq.Types.ComTypes.dll

src/Moq.Tests.ComTypes/README.md

4.20.722.2 KB
Original Source

Moq.Types.ComTypes.dll

This directory contains an assembly Moq.Types.ComTypes.dll containing Component Object Model (COM) interop types, used to test various aspects of Moq compatibility with COM.

This assembly can be built from the ComTypes.idl definition file also contained in this directory.

Building

Requirements

In order to build the DLL, you will need the following tools:

Steps

Open a command prompt and ensure that the tools mentioned above can be found in the PATH. For instance, start Visual Studio's developer command prompt.

Next, you can either run the BuildDLLFromIDL.cmd batch file found in this directory, or run the following equivalent steps manually:

  1. Create a COM Type Library (a .tlb file) from the .idl definition:

    midl.exe /mktyplib203 ^
             /env win32 ^
             /tlb ComTypes.tlb ^
             ComTypes.idl
    
  2. Convert the generated type library to a .NET interop types assembly:

    tlbimp ComTypes.tlb ^
           /out:Moq.Tests.ComTypes.dll ^
           /namespace:Moq.Tests.ComTypes ^
           /keyfile:..\..\Moq.snk ^
           /asmversion:4.0.0.0
    
  3. Optionally verify the generated assembly:

    peverify Moq.Tests.ComTypes.dll