This recipe shows how to create a console application that will be able to use the WinRT API.
To step through this recipe, you will need Visual Studio 2012 and the Windows 8+ operating system. There are no other prerequisites. The source code for this recipe can be found at 7644_Code\Chapter11\Recipe2
.
To understand how to use WinRT from usual applications, perform the following steps:
Start Visual Studio 2012. Create a new C# Console Application project.
Right-click on the created project in Visual Studio Solution Explorer and select the Unload Project… menu option.
Right-click on the unloaded project and select the Edit ProjectName.csproj menu option.
Add the following XML below the
<TargetFrameworkVersion>
element:<TargetPlatformVersion>8.0</TargetPlatformVersion>
Save the
.csproj
file, right-click on the unloaded project in Visual Studio Solution Explorer, and select the Reload Project menu option.Right-click...