Reputation: 20050
I'd like to create a tool that accepts a .winmd
file (Windows Runtime Component) and generates a C# DLL out of it (containing all the public types defined in the component).
As far as I've learned, standard .NET Reflection APIs cannot work on .winmd files, and one must used the Metadata Unmanaged APIs to access that information.
The question is -- is it possible to construct a C# assembly out of the information that is retrieved from the Metadata API?
Or better yet -- is there a tool (like TLBIMP) that already does this job or something similar?
Upvotes: 2
Views: 1661
Reputation: 16142
A windows metadata file doesn't contain any code - it's just a set of type definitions. And a winmd file is an ECMA 335 assembly, so it already is a C# DLL (just rename it from .winmd to .dll).
Upvotes: 1