简体   繁体   English

尝试运行桌面扩展应用程序时,UWP(C#)中的“访问被拒绝”

[英]“Access is denied” In UWP (C#) when trying to run desktop extension App

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 ). 我正在尝试为FullTrustProcessLauncher运行教程代码,以便从UWP运行桌面应用程序(正如我在从UWP运行python脚本中所问的那样)。

The source code is found here: UWP-FullTrust . 可在此处找到源代码: UWP-FullTrust Im running the first example: UWP_FullTrust_1. 我正在运行第一个示例:UWP_FullTrust_1。

It's compiles all ok but when I run the console command (Click the button) I get in the line 一切都可以编译,但是当我运行console命令(单击按钮)时,

await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();

this exeption: 这个例子:

"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. 我没有对代码进行任何更改,但是尽管它对代码的编写者有效,但对我而言却不是。

Target version is: 10.0 build: 16299. CPU: x64. 目标版本为:10.0内部版本:16299。CPU:x64。 (or any) VS: 2017 (或任何)VS:2017

Thanks. 谢谢。

This error indicates that you were attempting to launch the UWP project from VS directly, which doesn't have the required capability declared. 该错误表明您正在尝试直接从VS启动UWP项目,而该VS没有声明所需的功能。 Instead you will need to set the Package project as your startup project. 相反,您需要将Package项目设置为启动项目。 This project wraps both your UWP and your Win32 executables as one unit and sets up the required capabilities for execution. 该项目将UWP和Win32可执行文件打包为一个单元,并设置执行所需的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM