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

扶醉桌前 提交于 2019-12-11 09:34:27

问题


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).

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();

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. (or any) VS: 2017

Thanks.


回答1:


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.



来源:https://stackoverflow.com/questions/54852168/access-is-denied-in-uwp-c-when-trying-to-run-desktop-extension-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!