I am using a pre-build task in Visual Studio 2008 that invokes msbuild:
C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\\MSBuild.exe $(MSBuildProjectDirectory)\\
I don't think you are doing anything wrong - it's a bug.
I have reported it here - check if you can reproduce it and add a validation, maybe we can get it fixed by MS.
EDIT: I tried the suggestion by "Si" to update the file in the "BeforeBuild" event - however I still get the same wrong result with Visual Studio 2008/SP1.
UPDATE/WORKAROUND: MS has responded to the bug report. As a workaround you can add
FALSE
to your csproj file.