4

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.

Stefan Wick MSFT
  • 13,600
  • 1
  • 32
  • 51
Izik
  • 746
  • 1
  • 9
  • 25
  • 1
    Make sure you follow the instructions precisely: 1) select an architecture (x86/x64) - not AnyCPU. 2) set "Package" as the start up project. 3) then hit F5. See here: https://github.com/StefanWickDev/UWP-FullTrust/blob/master/UWP_FullTrust_1/README.md From the error it sounds like your UWP is the start up project, not the package. Please confirm and then I will post this as answer. – Stefan Wick MSFT Feb 24 '19 at 16:04
  • 1
    Thanks! working good, though I did all those things I probably changed other things too, and now when downloading project again with changes it is working. – Izik Feb 24 '19 at 16:36
  • Glad to hear it's working. Please mark as answered, so we get this off the radar. – Stefan Wick MSFT Feb 24 '19 at 16:57

1 Answers1

5

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.

Stefan Wick MSFT
  • 13,600
  • 1
  • 32
  • 51
  • I'm trying to use [OfficeInterop sample](https://github.com/microsoft/Windows-Packaging-Samples/tree/master/OfficeInterop) and I came across this issue. If I try to run DataGrid2Excel standalone, it dies quietly once I click button. Anything I can check? – mlt Feb 14 '20 at 02:40
  • Nevermind. All is good. I had to select package as StartUp project. Somehow got `DataGrid2Excel.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x000000A16F6FB760` but data appeared in Excel. Perhaps that error can be ignored. – mlt Feb 14 '20 at 03:02