Moving up a folder from the executable
<p>I am trying to make a file path inside of the folder above the executable. For instance, I am wanting the variable <code>TAGPATH</code> to be the filepath to an executable in the folder <code>C:\User\ApplicationFolder\tag_rw\tag_rw.exe</code> while the application is in <code>C:\User\ApplicationFolder\AppFiles</code>. I want the application to be portable, meaning no matter the folder names it will retrieve the filepath of the application's executable then go to the parent folder and navigate into <code>tag_rw\tag_rw.exe</code>.</p>

<p>I basically want <code>string TAGPATH = @"path_to_appfolder\\tag_rw\\tag_rw.exe"</code></p>

<p>Here is what I have tired so far (using the first answer <a href="https://stackoverflow.com/questions/14899422/how-to-navigate-a-few-folders-up">How to navigate a few folders up?</a> ):</p>

<pre><code>  string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
  string TAGPATH = System.IO.Path.GetFullPath(System.IO.Path.Combine(appPath, @"..\"));
</code></pre>

<p>I am getting a run-time error <code>ArgumentException</code> with the description <code>URI formats are not supported.</code></p>

<p>Is there an easier/better way to go about this?</p>

<p>Thank you!</p>