title: Modify .csproj in pre-build event
body: <p><strong>tl;dr:</strong> How to modify the <code>.csproj</code> file during publishing with <code>ClickOnce</code> while executing pre-build events?</p>
  
  <p><em><strong>Long:</em></strong>
  I'm using TFS hosted by Microsoft for version control of my solution.</p>
  
  <p>When publishing with <code>ClickOnce</code>, I get the latest revision number + 1 without problems. I also can successfully write the new version number into the <code>.csproj</code> file outside my build-process.</p>
  
  <p>The problem is, that the <code>.csproj</code> file doesn't get updated during the build process - it might be in a write-lock. I get a notification inside Notepad++ about the modification of the file, but the file still contains the old version and VS didn't notice any changes.</p>
  
  <p>The only solution by now I found to resolve this issue:
  Move the revision update into the post-build events and add 2 instead of one to the actual revision number. Unfortunately this would cause that revision number would be out of date whenever other developers check-in code.</p>