title: Obtaining the URI argument within a registered uap:protocol executable
body: <p>I have a C# WPF application and I've referenced that inside a MSIX package.
  I've also registered a URI protocol within the Package.appxmanifest of my MSIX package the following way:</p>
  <pre><code>&lt;uap:Extension Category=&quot;windows.protocol&quot; EntryPoint=&quot;AppLauncher&quot;
                      Executable=&quot;AppLauncher\AppLauncher.exe&quot;&gt;
                      &lt;uap:Protocol Name=&quot;app-drive&quot; &gt;
                      &lt;/uap:Protocol&gt;
  &lt;/uap:Extension&gt;
  </code></pre>
  <p>The goal is when I type <code>app-drive:\\C:\test.txt</code> into the file explorer or a browser for my executable to launch and within it I want to have the following string accessible  <code>C:\test.txt</code>.</p>
  <p>After I install my MSIX package and enter that string anywhere, my program launches correctly but that argument is nowhere to be found.</p>
  <p>Ways I've tried to obtain it so far:</p>
  <p>1.</p>
  <pre><code>[STAThread]
  static void Main(string[] args)
  {
   // args[0] contains &quot;-ServerName:App.AppXd****.mca&quot; string
  }
  </code></pre>
  <ol start="2">
  <li><p><code>Environment.GetCommandLineArgs()</code></p>
  </li>
  <li><p><code>protected override void OnStartup(StartupEventArgs e)</code></p>
  </li>
  </ol>
  <p>All of these contain only the string &quot;-ServerName:App.AppXd****.mca&quot; as a first argument.</p>
  <p>Note that I cannot use <code>Windows.ApplicationModel.AppInstance.GetActivatedEventArgs()</code> since my application is not UWP.</p>
  <p>Any suggestions?</p>
  <p><strong>Edit:</strong>
  Found the solution. Turns out in order for the parameter to be passed to the executable the EntryPoint has to be <code>EntryPoint=&quot;Windows.FullTrustApplication&quot;</code></p>