After a build fails in TFS 2010, all builds after it on the same agent fail until the service is restarted

This is an extension of an earlier problem I was talking about here: A VB.Net method is called multiple times when it actually isn't, and returns inconsistent results

At the time, I thought the problem was completely resolved, but I've since learned that there are several problems. I worked out all the kinks with code and logic and now I have narrowed down the last remaining problem.

The build will work fine until it is legally completed. After that, all builds on that particular agent will fail, even if there were no actual errors with subsequent builds. When they fail, I see the same symptoms as in another thread, which I will describe here:

  • A method that is called only once is called multiple times as evidenced by assembly messages
  • The build messages will show that there is 1 error, but there are errors in the logs generated by this method (the line to write the error to the log comes right after the line to which the error is added to the result log, in the same if statement)
  • Restarting the build service on the build server "fixes" the problem until the next time the build fails, after which the cycle starts again.

Build server setup:

  • Windows Server 2008 R2
  • VS 2010 Premium
  • The assembly uses a custom library
  • There are 4 build agents, one for each environment (Dev, QA, UAT, Prod)

The native build and deployment library is written in VB using .Net Framework 4.5 and it calls another library which is also written using .Net Framework 4.5.

The build template does not use msbuild. This is strictly WF, stripped down to the bare minimum and only invokes command line commands (like robocopy) or custom .net classes.

I have verified that if a build fails for one agent (eg Dev) then all builds using that agent will fail. When this happens, ONLY builds that run on that particular agent fail, other agents work fine. I haven't had a chance to test yet if only restarting the agent will "fix" it, or if I have to restart the entire service.

I tried clearing the Visual Studio cache for the user account running the builds, but that didn't help at all. I also have a GUI that I created that does all the same functionality as an assembly and uses all the same code and I can't get it to repeat the behavior.

I have enabled the logs on the build controller in the following steps: How do I enable the agent build or controller build logs? However, they were not helpful when this issue occurred (no errors were logged, there was nothing in the logs for assemblies that were better than the ones that were disabled)

I'm not sure what my next troubleshooting steps should be, I know the problem is not in my code and I have no luck finding it on the internet via Google, MSDN, StackOverflow, or picking the brains of my peers in other organizations.

I'm wondering if this could be a bug due to running code that requires .NET Framework 4.5 in a TFS 2010 build as it only officially supports up to 4.0.

+3


source to share


1 answer


My advice would be to change the build logger to diagnostics and see the result, garbage should be added to the environment.

You can do this with a switch like



/l:FileLogger,Microsoft.Build.Engine;logfile=c:\build.log;Verbosity=Diagnostic

      

you can look here

0


source







All Articles