Error CS0246 The type or namespace name 'DeploymentProgress' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DeploymentResult' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'IAsyncOperationWithProgress<,>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0234 The type or namespace name 'Management' does not exist in the namespace 'Windows' (are you missing an assembly reference?)
主要原因是对应的库依赖Windows.winmd这个文件,没有找到这个文件导致编译失败,改成能找到的路径就可以了,比如我的Windows.winmd在C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22000.0\Windows.winmd这个路径,将References里的Windows改成引用这个路径
或者修改注册表,HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0更改ProductVersion的值