.netwindows-runtimewinmd

Given a .winmd file, where can we find the real implementation DLL?


I have question that given a .winmd file, where can we find the real implementation is? .winmd files just like a head file or dynamic library's .lib file, it doesn't contain any implementation, I curious that where is its implementation. Thanks.


Solution

  • You can't. A .winmd file just contains type declarations, it contains no code. It is the exact equivalent to a type library (.tlb) as used in COM Automation. The logical equivalent to a .h file in a C or C++ program.

    The .tlb format was too restrictive to support WinRT and was re-engineered into .winmd, the format of the file is identical to .NET metadata and you can use .NET tooling (like ildasm.exe) to see its content. A compiler uses it to know how to generate proper code to use a WinRT component, just like a C++ compiler knows how to use a class library by #including a .h file that contains the class declarations.

    And just like a .h file, it is up to you to figure out what executable file implements the types and to deploy it to the user's machine. Unless it is Windows.winmd, the one that declares all the built-in WinRT types, you'd expect the binary component to be very close to the .winmd file. Store requires you to include that binary component in your package. Ask the author of the component for help if you need assistance.