title: UWP FullTrustProcessLauncher gives "Element not found" exception on launch
body: <p>I have a solution in visual studio containing a Windows Application Packaging Project, a UWP project, and a Console Application project. The UWP app contains a single button that when pressed is supposed to launch the console application as a fulltrust process. Solution Explorer looks like this:</p>
  <p><a href="https://i.stack.imgur.com/r6diN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r6diN.png" alt="Solution Explorer" /></a></p>
  <p>The Windows Application Packaging project is set as the startup project. It's entry point is set to the UWP app. Both the UWP app and the console app are added to the packaging project as references.</p>
  <p><a href="https://i.stack.imgur.com/mP1IG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mP1IG.png" alt="Package References" /></a></p>
  <p>Configuration manager looks like this:</p>
  <p><a href="https://i.stack.imgur.com/D7tFA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D7tFA.png" alt="Configuration Manager" /></a></p>
  <p>The console app is set as a dependency for the UWP app. The dependencies for the UWP app looks like this:</p>
  <p><a href="https://i.stack.imgur.com/syMUo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/syMUo.png" alt="UWP dependencies" /></a></p>
  <p>The build order look like this:</p>
  <p><a href="https://i.stack.imgur.com/7hEdv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7hEdv.png" alt="Build Order" /></a></p>
  <p><strong>Code</strong></p>
  <p>Here is the code for the console app:</p>
  <pre><code>using System;
  using System.Diagnostics;
  
  namespace ShellHost
  {
      class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine(&quot;Hello World!&quot;);
  
              Console.WriteLine(&quot;Press any key to exit...&quot;);
              Console.ReadKey();
          }
      }
  }
  </code></pre>
  <p>As I mentioned the UWP app only has one page (MainPage.xaml) and it's code behind looks like this:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  using System.Runtime.InteropServices.WindowsRuntime;
  using Windows.Foundation;
  using Windows.Foundation.Collections;
  using Windows.UI.Xaml;
  using Windows.UI.Xaml.Controls;
  using Windows.UI.Xaml.Controls.Primitives;
  using Windows.UI.Xaml.Data;
  using Windows.UI.Xaml.Input;
  using Windows.UI.Xaml.Media;
  using Windows.UI.Xaml.Navigation;
  using Windows.ApplicationModel;
  
  namespace OnScreenDeviceManager
  {
      public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              this.InitializeComponent();
          }
  
          private async void button_Click(object sender, RoutedEventArgs e)
          {
              await FullTrustProcessLauncher.LaunchFullTrustProcessForAppAsync(&quot;Default&quot;);
          }
      }
  }
  </code></pre>
  <p>The manifest for the UWP app is unmodified. The manifest for the Package has been modified to include fulltrust capability, and it contains the necessary extension for the fulltrust process. The xml file looks like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;Package
    xmlns=&quot;http://schemas.microsoft.com/appx/manifest/foundation/windows10&quot;
    xmlns:uap=&quot;http://schemas.microsoft.com/appx/manifest/uap/windows10&quot;
    xmlns:rescap=&quot;http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities&quot;
    xmlns:desktop=&quot;http://schemas.microsoft.com/appx/manifest/desktop/windows10&quot;
    IgnorableNamespaces=&quot;uap rescap desktop&quot;&gt;
  
    &lt;Identity
      Name=&quot;d3e964dc-9265-4243-b97c-2dacb7c11dac&quot;
      Publisher=&quot;CN=Dell&quot;
      Version=&quot;1.0.0.0&quot; /&gt;
  
    &lt;Properties&gt;
      &lt;DisplayName&gt;Package&lt;/DisplayName&gt;
      &lt;PublisherDisplayName&gt;Dell&lt;/PublisherDisplayName&gt;
      &lt;Logo&gt;Images\StoreLogo.png&lt;/Logo&gt;
    &lt;/Properties&gt;
  
    &lt;Dependencies&gt;
      &lt;TargetDeviceFamily Name=&quot;Windows.Universal&quot; MinVersion=&quot;10.0.0.0&quot; MaxVersionTested=&quot;10.0.0.0&quot; /&gt;
      &lt;TargetDeviceFamily Name=&quot;Windows.Desktop&quot; MinVersion=&quot;10.0.14393.0&quot; MaxVersionTested=&quot;10.0.14393.0&quot; /&gt;
    &lt;/Dependencies&gt;
  
    &lt;Resources&gt;
      &lt;Resource Language=&quot;x-generate&quot;/&gt;
    &lt;/Resources&gt;
  
    &lt;Applications&gt;
      &lt;Application Id=&quot;App&quot;
        Executable=&quot;$targetnametoken$.exe&quot;
        EntryPoint=&quot;$targetentrypoint$&quot;&gt;
        &lt;uap:VisualElements
          DisplayName=&quot;Package&quot;
          Description=&quot;Package&quot;
          BackgroundColor=&quot;transparent&quot;
          Square150x150Logo=&quot;Images\Square150x150Logo.png&quot;
          Square44x44Logo=&quot;Images\Square44x44Logo.png&quot;&gt;
          &lt;uap:DefaultTile Wide310x150Logo=&quot;Images\Wide310x150Logo.png&quot; /&gt;
          &lt;uap:SplashScreen Image=&quot;Images\SplashScreen.png&quot; /&gt;
        &lt;/uap:VisualElements&gt;
        &lt;Extensions&gt;
          &lt;desktop:Extension Category=&quot;windows.fullTrustProcess&quot; Executable=&quot;ShellHost\ShellHost.exe&quot;&gt;
              &lt;desktop:FullTrustProcess&gt;
                  &lt;desktop:ParameterGroup GroupId=&quot;SyncGroup&quot; Parameters=&quot;/Sync&quot;/&gt;
                  &lt;desktop:ParameterGroup GroupId=&quot;OtherGroup&quot; Parameters=&quot;/Other&quot;/&gt;
                  &lt;desktop:ParameterGroup GroupId=&quot;Default&quot; Parameters=&quot;&quot;/&gt;
              &lt;/desktop:FullTrustProcess&gt;
          &lt;/desktop:Extension&gt;
        &lt;/Extensions&gt;
      &lt;/Application&gt;
    &lt;/Applications&gt;
  
    &lt;Capabilities&gt;
      &lt;Capability Name=&quot;internetClient&quot;/&gt;
      &lt;rescap:Capability Name=&quot;runFullTrust&quot; /&gt;
    &lt;/Capabilities&gt;
  &lt;/Package&gt;
  </code></pre>
  <p>The package/debug/bin folder where the solution exe resides looks like this:</p>
  <p><a href="https://i.stack.imgur.com/MadJm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MadJm.png" alt="Package Directory" /></a></p>
  <p>You can clearly see the console app exe (ShellHost.exe) in the ShellHost folder.</p>
  <p>The console app has been tested and works just fine. The UWP app works just fine except when I click the button I get an 'Element not found' exception.</p>
  <p>Exception message says:</p>
  <pre><code>System.Exception: 'Element not found. (Exception from HRESULT: 0x80070490)'
  
  This exception was originally thrown at this call stack:
      [External Code]
      OnScreenDeviceManager.MainPage.button_Click(object, Windows.UI.Xaml.RoutedEventArgs) in MainPage.xaml.cs
  </code></pre>
  <p>Can anyone help me solve this? What am I missing?</p>