It’s been said that you can create a C++ WinRT component that you can consume in C#. I have a simple test project – a C# XAML app, and a C++ project using just the basic WinRT Component project template. When I try to add a project reference in the C# XAML project, it says it cannot add the reference (not sure why). I can build the native WinRT component, and a .winmd file is generated, and I can add a reference to this .winmd file manually using the browse button in the add reference dialog. This allows me to access the methods in the native library, but when I build, it says it is using Platform.IDisposable, but that type is defined in an assembly that isn’t referenced. I haven’t seen any of the sessions demonstrate this scenario.
Share
Found the answer! Looks like it’s a glitch, but it has a work-around:
http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/1900bd21-8693-4127-800a-f35cfd5daac2
Basically, first you clean the WinRT component project, then you add the reference, then add a reference manually to platform.winmd located in \VC\bin then you should be good to go.