Running a C# program from SD-card but shows it ran from temp directory
<p>I have come across a strange problem which I would like to get your help about. </p>

<p>In my mobile app the program writes a windows C# program (and dependencies) on SD-card so that user can run it on his PC when SD-card is mounted on PC. 
The program and dependencies are copied at root level like this.</p>

<ul>
<li>myprogram.exe</li>
<li><p>myprogram.exe.config  [Just for info : config has the runtime
binding and Libs folder]</p></li>
<li><p>Libs\Interop.iTunesLib.dll</p></li>
</ul>

<p>I received an error report from a user like this. I could not reproduce this on my end</p>

<pre><code>OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
Assembly version: 1.0.0.0
CurrentDirectory: C:\Users\yasd\AppData\Local\Temp\WPDNSE\SID-{10001,SECZ9519043CHOHB,4820242432}
Problem: Could not load file or assembly 'Interop.iTunesLib, Version=1.11.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
</code></pre>

<p>Now the problem as I see is that the current directory of the program as I get in the report is</p>

<pre><code>"C:\Users\yasd\AppData\Local\Temp\WPDNSE\SID-{10001,SECZ9519043CHOHB,4820242432}" 
</code></pre>

<p>I was expecting it to be something like </p>

<pre><code>F:\
</code></pre>

<p>Because user ran it from the root of the SD card and not on the temporary folder of windows.</p>

<p>and my assessment is that because this path is wrong it could not load dependent assemblies, </p>

<p>Why would something go into temporary directory in C# if ran from SD card ??? I asked the user he did not copy any files out of SD card and ran from SD card.</p>

<p>Please help, any advise highly appreciated.</p>
