How to not get "ERROR_FILE_IN_USE " error when deploying a ASP.NET Core website using FTP/shared folder?
<p>I have an <code>ASP.NET Core RTM</code> Web Application that targets  <code>.net framework 4.52</code></p>

<p>In my <code>project.json</code></p>

<pre><code>"frameworks": {
    "net452": {}
  },
</code></pre>

<p>When I publish it to an folder it creates a <code>MyWebApplication.exe</code> and when I access the app in my browser the exe is run.</p>

<p>I need to publish the website to  a web server that has <code>Windows Server 2012</code> and <code>IIS8</code></p>

<p>I have shared folder access via VPN to the website deploy directory.</p>

<p>The first time I publish the site to the folder it worked correctly. I access the website url and the site loads. However when I want to republish the website after making changes and copying over the files it tells me the <code>MyWebApplication.exe</code> is in use and the publish fails.</p>

<p>The only way I know how to resolve this is to before publishing to kill the <code>MyWebApplication.exe</code> in task manager on the web server. However since I only have access to that server through a shared directory this is not possible.</p>

<p>With <code>ASP.NET 4</code> websites  I don't have this problem.</p>

<p>With <code>ASP.NET CORE RC1</code> I also didn't have the problem as it was using <code>dnx</code> though the <code>HTTPPlatformHandler</code> which allowed me to copy the site without having to kill the <code>dnx.exe</code>. I just had to touch the <code>web.config</code> and the site would restart.</p>

<p>My questions are:</p>

<ol>
<li><p>Is there a way to copy over/publish a new changed version of a site that had already been deployed (Either FTP or via shared folder access)?</p></li>
<li><p>Is there a way to stop the website e.g. unload the <code>MyWebApplication.exe</code> from memory on the web server either via FTP or via shared folder access?</p></li>
</ol>