UWP and FullTrustProcessLauncher missing in namaspeace

北城以北 提交于 2019-12-13 02:45:17

问题


I am trying to launch powershell (some lightweight commands that all user can do) command from UWP application using FullTrustProcessLauncher.

Problem is I am getting that this name does not exists in current context.

My manifest is largly default so it looks like :

<?xml version="1.0" encoding="utf-8"?>

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"

  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
  xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"

  IgnorableNamespaces="uap mp">

 <Dependencies>
   <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
 </Dependencies>

 <Resources>
   <Resource Language="x-generate"/>
 </Resources>

 <Applications>
   <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="PrototypeProject.App">

     <Extensions>
        <desktop:Extension Category="windows.fullTrustProcess" Executable="powershell.exe">
      <desktop:FullTrustProcess>
        <desktop:ParameterGroup GroupId="TestGroup" Parameters="ls"/>
      </desktop:FullTrustProcess>
    </desktop:Extension>
  </Extensions>

   </Application>
 </Applications>

 <Capabilities>
   <Capability Name="internetClient" />

   <rescap:Capability Name="runFullTrust"/>

  </Capabilities>
</Package>

And class I am trying to call it from looks like:

using Windows.ApplicationModel;
using Windows.Foundation;

namespace FullTrustProcess
{
    public class Ftp
    {
        public const string FtpParamGroupId = "TestGroup";

        public void RunFtp()
        {
            IAsyncAction operation = FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(FtpParamGroupId);
        }
    }
}

Now am I missing something??


回答1:


It looks like I was missing - Windows Desktop Extensions for the UWP, in extensions reference



来源:https://stackoverflow.com/questions/47133789/uwp-and-fulltrustprocesslauncher-missing-in-namaspeace

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