TeamCity building incorrect source code using Perforce

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.


Thank you

Max Young


Which version of teamcity are you running? The build log from a build that has incorrect revisions would be useful, you can use the "Submit a request" button on top to send it to us.


Sorry I never noticed a notification in my email for this. I don't have the logs any more for this, it still happens occasionally but it is very rare. When I have it happen again I will submit it.


Please sign in to leave a comment.