It is beyond doubt that WinRT simplifies the development of our Apps, specially when we’ve to access devices like webcams or gyroscopes. But, is it possible to use these new APIs from our good old friend Winforms or are they restricted to Windows Store Apps?
I don’t know why Visual Studio does not allow you to use them out of the box, but don’t worry cause the procedure to enable that feature is quite simple. Just follow these steps:
- Open your .csproj file with your favorite text editor
- Add the following element as a child of the Project element:
<PropertyGroup> <targetplatformversion>8.0</targetplatformversion> </PropertyGroup>
That’s it! Now you can open the project with Visual Studio and you’ll be able to add a reference to WinRT: