When I am building our project C# solution using the Visual Studio build step and Perforce we are sometimes getting older versions of the source despite TeamCity reporting the correct change list in the parameters.We are manually triggering builds and are not using hooks to trigger builds. It seems like some times it gets the correct source and some times it takes two builds before it gets the newest source.
This seems to happen the closer the build is requested to the change being checked in. For example we have a PowerShell script for updating our SharedAssemblyInfo.cs to the next minor version every time a release build is requested. This script is checking out the file using the client env.P4Client and it succeeds in updating the file and checking it in. After the build completes though the build will still be on the previous version. This is just the easiest way I have of reproducing the issue but I have had reports from other members of the team this is happening with their code as well.
Any suggestions would be greatly appreciated and any if you need any logs or configurations from our TeamCity server I can provide those.