title: Releasing files after program finishes
body: <p>I've inherited a web application project that was built in vb.net that is running on my server (Windows Server 2012 running IIS 8).  The project relies on some .dll libraries that are also build by my company in a separate project, and will output error messages to a .txt file.  The main structure of the project was set up by a previous programmer that is no longer with my company.  I was given some copy-paste code to add new .dlls when needed, but how it works was never really explained to me and isn't really documented in comments or anything else like that.</p>
  
  <p>I discovered that if I trigger the project to run, I am unable to delete the .dll file that was called or the .txt file until long after the program has finished running (Windows tells me the file is still in use).  I expected that the project would release these files as soon as the process that was using them completes.  I have noticed this behavior both when running in the live environment on my server and also when debugging on my local machine (Windows 10).</p>
  
  <p>This leads me to a couple related questions:</p>
  
  <ul>
  <li>If files aren't released as soon as the process finishes using them, when are they release?</li>
  <li>When the project is running on the server, what happens if two users try to access the same .dll or write to the .txt file at the same time?</li>
  <li>Is there any code I can put in my project after my .dll calls to force the .dll to be released at a specified point in its execution?  If that isn't something that can be done in the code, is there any other way to get files to release after the program has finished running (like some setting or flag in the compiler or on my server)?</li>
  </ul>