title: How do you compiling cs file modification on a deployed website? Is it possible?
body: <p>If this has been asked before, I apologize.</p>
  
  <p>If I had a currently deployed ASP.Net C# website which had a slight bug or modification needed in a cs file, would it be possible to modify the cs file and have IIS recompile the ASP.Net website rather than using Visual Studio or SharpDevelop to rebuild the site?</p>
  
  <p>I'm familiar with PHP websites where a change is compiled automatically. Is there a way to get ASP.Net or IIS to do something similar to the code-behind files of an ASP.Net website?</p>
  
  <p>I understand that modifying the web.config file may force a recompile, and modifying the ASPx files automatically displays the changes, but I haven't found the same success in the code behind files.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Edit (Answer below):</strong> </p>
  
  <p>The command to recompile an existing ASP.Net website using existing sources (including the solution file) is this:</p>
  
  <pre><code>%windir%\microsoft.net\framework\v4.0.30319\msbuild /m Solution.sln /p:Configuration=Debug
  @IF %ERRORLEVEL% NEQ 0 GOTO err
  @exit /B 0
  :err
  @PAUSE
  @exit /B 1
  </code></pre>
  
  <p>Paste the above code into a batch file within your solution directory. Change the Solution.sln to your solution file, modify the framework to match your installed version. You can change the Configuration option to "Release" as well.</p>
  
  <p>* Batch file code used from SharpDevelop source code. Idea based on this forum post: <a href="http://community.sharpdevelop.net/forums/t/8281.aspx" rel="nofollow">http://community.sharpdevelop.net/forums/t/8281.aspx</a></p>