【问题标题】:UWP and FullTrustProcessLauncher missing in namaspeacenamaspeace 中缺少 UWP 和 FullTrustProcessLauncher
【发布时间】:2017-11-06 19:49:18
【问题描述】:

我正在尝试使用 FullTrustProcessLauncher 从 UWP 应用程序启动 powershell(所有用户都可以执行的一些轻量级命令)命令。

问题是我得到这个名字在当前上下文中不存在。

我的清单很大程度上是默认的,所以它看起来像:

<?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>

我尝试调用它的类看起来像:

using Windows.ApplicationModel;
using Windows.Foundation;

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

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

现在我错过了什么吗??

【问题讨论】:

    标签: powershell uwp


    【解决方案1】:

    我好像不见了 - UWP 的 Windows 桌面扩展,在扩展参考中

    【讨论】:

    • 我知道,但是 SO 明天会给我这个机会来做这件事 :) 这是限制 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-21
    • 2016-04-08
    • 2017-10-24
    相关资源
    最近更新 更多