Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

ProcessLauncher UnauthorizedAccessException #463

Open
YAJeff opened this issue May 16, 2020 · 1 comment
Open

ProcessLauncher UnauthorizedAccessException #463

YAJeff opened this issue May 16, 2020 · 1 comment

Comments

@YAJeff
Copy link

YAJeff commented May 16, 2020

We've leveraged the capability of ProcessLauncher. Seems to work fine on some devices. On some others, we get an UnauthorizedAccessException. Details below:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at MarqMetrix.InstrumentManagement.FileSystem.NetworkLocations.IoT.IoTNetworkLocationManager.AddNetworkLocation(String share, String username, String password)
at MarqMetrix.InstrumentManagement.InstrumentManager.AddNetworkLocationAsync(NetworkLocation networkLocation)
at MarqMetrix.InstrumentManagement.WebApi.ODataControllers.NetworkLocationsController.Post(Delta`1 newNetworkLocation)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at MarqMetrix.InstrumentManagement.InstrumentManagerApplicationBuilderExtensions.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context

So far we've tested on 3 different devices. Each running an 1809 version of IoT Core. 2 boxes, the process launcher works. 1 box it doesn't. Interestingly, the box that it doesn't work on is the most recently setup device (flashed with IoT Core).

In looking at the folder permissions in the location the app is installed, it appears there is a difference between the boxes this works on and the one it doesn't.

@justin-rapiddeploy
Copy link

We are having the same issue when attempting to launch executables from the AppX package using the ProcessLauncherSample on devices running 1809 of Windows IoT Core. We've determined that the sample runs correctly on the device when deploying from Visual Studio both with .exe paths added to the registry in the AllowedExecutableFilesList and from the AppX, however we get the System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) error when sideloading the AppX via Device Portal or deploying OTA via the DM API and device twin. It appears that access to C:\Data\Programs\WindowsApps is not allowed to ProcessLauncher even when the path is added to AllowedExecutableFilesList which prevents programs from being run from AppX.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants