我添加了以下行:
FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
但我希望能够检查这是否有效(最好没有try-catch块)。有没有办法测试桌面扩展是否存在?
答案 0 :(得分:6)
建议的方法是:
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
}