title: Is stop-site required when copying new dll to IIS
body: <p>We created a deployment pipeline to deploy our web-site to remote servers.</p>
  
  <p>We used <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/psexec" rel="nofollow noreferrer">psexec.exe</a> to <a href="https://gist.github.com/sdesalas/6533286" rel="nofollow noreferrer">control iis remotely</a>. This works fine. </p>
  
  <p>I will explain our load balancer logic.</p>
  
  <p>We are hosting our web-site after a load balancer. Load balancer looks every server and reads a text file. If text file includes "abc" it sends requests to that server. If text file includes something different it doesn't send.</p>
  
  <p>I seperated my servers virtually. I always have half running servers. </p>
  
  <p>I follow these steps to in first part to copy new code to web-site:</p>
  
  <ol>
  <li>Change load balancer file content to something different ex:"cde"</li>
  <li>Wait 15 seconds </li>
  <li>PsExec.exe stop site <strong>(I'm having 404 errors now)</strong></li>
  <li>PsExec.exe stop apppool</li>
  <li>Wait 15 seconds </li>
  <li>Copy new files to site folder</li>
  <li>PsExec.exe start apppool</li>
  <li>PsExec.exe start site <strong>(No 404 Errors any more)</strong></li>
  <li>Wait 5 seconds </li>
  <li>Change load balancer file content to "abc"</li>
  </ol>
  
  <p>When i stop the web-site, load balancer can't read the file and sends requests to closed site and it gives 404 ERROR, until the opening web-site!</p>
  
  <p>My question is:</p>
  
  <ul>
  <li>Do we need to stop site to copy new files? </li>
  <li>What is the difference between stopping app-pool and stopping-site while copying files?</li>
  <li>If i need to stop site, do you have any suggestion to load balancer requests?</li>
  </ul>
  
  <p>Thank you.</p>