来自http://stackoverflow.com/questions/13016645/how-to-access-the-windows-management-deployment-namespace
You can use WinRT APIs from desktop applications.
Just add
<PropertyGroup>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>
to the .csproj
.
1. add Windows.winmd: C:\Program Files (x86)\Windows Kits\8.0\References\CommonCOnfiguration\Netural\Windows.winmd
2. add System.Runtime.WindowsRuntime.dll,可以在
C:\Windows\Microsoft.NET\Framework\v4.0.30319