Building Windows Runtime Components

After removing the Random property, we can compile our component, resulting in a WINMD file, as shown in Figure 32.18.

Image

FIGURE 32.18 Our WinRT component’s WINMD file.

Just like all the Windows APIs for Windows Store applications are described in a Windows Metadata (WINMD) file, our own component is turned into such a file. Under the hood, the compilation process consists of two steps. First, the C# compiler kicks in to compile our code. But instead of writing the result to a .dll file, it emits a .winmdobj file by running with the /t:winmdobj flag. Next, the WinMdExp.exe tool from the Windows SDK is called to ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.