缺少UWP的Windows桌面扩展SDK

问题描述 投票:0回答:1

我尝试重复此manual。我的项目是空白的WPF +空白的UWP应用。

  • 目标版本Windows 10(1903),10.0建立18362
  • 最低版本Windows 10(1903),10.0;内部版本17763

我已经安装了SDK Windows 10(10.0.18362.0)screenshot

我没有引用用于UWP的Windows桌面扩展SDKscreenshot

怎么了?如何为UWP添加Windows Desktop Extension SDK for UWP?

我尝试安装从16299到18362的所有版本的SDK,重新安装并修复了vs studio。从微软手动安装Windows 10 SDK也没有帮助。我发现information UWP的Windows桌面扩展SDK已合并到主UWP数据包。

但是当我尝试在没有Windows桌面扩展SDK的情况下运行项目时,出现错误

错误CS0103名称'FullTrustProcessLauncher'在当前上下文中不存在

        if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
        {
            await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
        }

当我尝试从没有Windows桌面扩展SDK的manul中运行github示例时,我有相同的错误

c# wpf uwp desktop-bridge
1个回答
0
投票

找到解决方案。

出于随机原因,您的Windows SDK可以安装到错误的目录。对我来说C:\Program Files (x86)\Microsoft Platform SDK。正确的路径是C:\Program Files (x86)\Windows Kits\10我刚刚做了符号链接

mklink /j “C:\Program Files (x86)\Windows Kits\10” “C:\Program Files (x86)\Microsoft Platform SDK”
© www.soinside.com 2019 - 2024. All rights reserved.