“访问被拒绝"在 UWP (C#) 中尝试运行桌面扩展应用程序时 [英] "Access is denied" In UWP (C#) when trying to run desktop extension App

查看:29
本文介绍了“访问被拒绝"在 UWP (C#) 中尝试运行桌面扩展应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 FullTrustProcessLauncher 运行教程代码,为了从 UWP 运行桌面应用程序(正如我在 Run python script fromUWP).

I'm trying to run a tutorial code for FullTrustProcessLauncher, In order to run desktop Application from UWP (As I asked in Run python script from UWP).

源代码位于此处:UWP-FullTrust.我正在运行第一个示例:UWP_FullTrust_1.

The source code is found here: UWP-FullTrust. Im running the first example: UWP_FullTrust_1.

编译一切正常,但是当我运行控制台命令(单击按钮)时,我进入了行

It's compiles all ok but when I run the console command (Click the button) I get in the line

await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();

这个例外:

"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

我不会对代码进行任何更改,虽然它对代码作者来说很有效,但对我来说却不是.

I dont make any changes to the code, but while it's working good for the code's author, for me it's not.

目标版本是:10.0版本:16299.CPU:x64.(或任何)对比:2017

Target version is: 10.0 build: 16299. CPU: x64. (or any) VS: 2017

谢谢.

推荐答案

此错误表示您试图直接从 VS 启动 UWP 项目,但该项目没有声明所需的功能.相反,您需要将 Package 项目设置为您的启动项目.此项目将您的 UWP 和 Win32 可执行文件打包为一个单元,并设置执行所需的功能.

This error indicates that you were attempting to launch the UWP project from VS directly, which doesn't have the required capability declared. Instead you will need to set the Package project as your startup project. This project wraps both your UWP and your Win32 executables as one unit and sets up the required capabilities for execution.

这篇关于“访问被拒绝"在 UWP (C#) 中尝试运行桌面扩展应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆