I am using MSBuild from a script to compile my project. I have noticed that it just does a build and not a clean/rebuild.
I have the following:
"%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild" Project.sln /p:Configuration=Release /t:Rebuild