通用Windows平台(UWP)挂起在Process.StandardOutput.ReadToEnd上

通用Windows平台(UWP)挂起在Process.StandardOutput.ReadToEnd上,uwp,adb,windows-10-universal,Uwp,Adb,Windows 10 Universal,当我运行process.StandardOutput.ReadToEnd下面的方法时,挂起并或返回空。但是使用控制台应用程序,确切的方法运行得很好。在UWP中是否有我缺少的东西需要添加到该方法中 private void GetDeviceProperties() { Process process = new Process(); process.StartInfo.FileName = "adb.exe"; process.Star

当我运行process.StandardOutput.ReadToEnd下面的方法时,挂起并或返回空。但是使用控制台应用程序,确切的方法运行得很好。在UWP中是否有我缺少的东西需要添加到该方法中

  private void GetDeviceProperties()
    {
        Process process = new Process();
        process.StartInfo.FileName = "adb.exe";
        process.StartInfo.Arguments = "shell getprop"; 
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.RedirectStandardError = true;
        process.Start();
        //* Read the output (or the error)
        string output = process.StandardOutput.ReadToEnd();
        string err = process.StandardError.ReadToEnd();
        process.WaitForExit();
    }

UWP运行在沙盒环境中,似乎无法从UWP直接执行或启动exe。不过,您可以尝试使用该类启动URI或文件