MSBuild files accessing problem


   I am working on couple of C# projects and we are planning to automate the build execution as well as nunit test execution. Earlier we choosen the MSBuild  as a build runner to all the projects.But, we had a problem with ClearCase integration. So we are using the Commandline runner as a build runner to our projects. In the command prompt, we are starts the view with the help of "ClearTool" and access the files and executes the builds. Here  i am getting  one problem with this approach.

If i executes the build for the first time then its giving the error as " MSBUILD : error MSB4025: The project file could not be loaded. Incorrect function."  To verify whether there is an error in the msbuild files, i have executed all the msbuild files from the command prompt and i didn't see any failure. Once if i executes the msbuild script files from the command prompt then immediately i tried to executes the build with Teamcity and its working fine.  I saw this kind of behaviour for all the projects.  If i not executed the msbuild script files from the command prompt then its still giving the above mentioned error.

If i kept the Teamcity server and build agent as idle for some time and  i tried to execute the build but still getting the same problem. I dont know the reason why the msbuild script files are not executing the builds for the first time.  

Thanks in Advance

Comment actions Permalink

Hi Vara!

Maybe, MSBuild isn't run from the right folder whereas when you run it, you are in the right folder, no?

I've not sure to understand the way you want to run builds: you launch a cmd batch script that performs ClearCase operation and then that performs MSBuild operations? You could use the MSBuild runner and in the MSBuild project file launch first ClearCase operations (with cleartool.exe)...


Comment actions Permalink

What have you set for "VCS checkout mode" on "Version control settings" tab of build configuration settings?
Do you have any VCS roots attached?

I've created an issue to let to copy-paste msbuild script to TeamCity msbuild runner settings to let is start without
any files checked out. Please watch/vote for it at



Please sign in to leave a comment.