C# Program Runs in Debug Mode but not Directly by the Executable
<p>Hi everyone.</p>
<p>
I am trying to create a program in C# that edits a file using a graphical interface.  I have done this type of thing before many times without fail, but this time was different.  I was able to debug it fine, but when I went directly to the executable file in its folder it did not open.  It showed no sign of even running.
</p>
<p>
Curious about this phenomenon I looked in task manager and it did not show up.  I tried to delete the file, but it said:
</p>
<blockquote>
<p>This action can't be completed because the file is open in  System
<br/>Close the file and try again</p>
</blockquote>
<p>
I could not find "System" this in task manager so I when to Resource Monitor.<br/>I found my program open in there (not under System), so I tried to kill the process.  That resulted in the following dialog box:
</p>
<blockquote>
<p>When attempting to execute the command, the following system error occurred:
<br/>Access is denied.</p>
</blockquote>
<p>
I went online and tried to download programs that would kill the process automatically, but to no avail.  They all gave me errors similar to the "Access Denied" error stated above.
</p>
<p>Things I've Tried:</p>
<ol>
<li>Kill the process</li>
<li>Reinstall the .NET library selected in the project properties</li>
<li>Restarting my computer</li>
</ol>
<p>
The only thing out of those three that worked was restarting my computer.  This released the executable and I was able to delete it and recompile my program, but as soon as I would run it the same thing repeated its self.
</p>
<p>
My program features heavy graphics, multiple threads, and references to multiple libraries.  I do not know if any of these are causing this problem, but I thought that I might include them anyway.
</p>
<p>
Like I said before, I have done this type of thing before, but I do not know what I am doing wrong now.  Thank you for any help.
</p>