Can't build using TF Service, builds locally fine

10,292

The error you're getting is occurring within the build template that your build definition is using. Build templates are Windows Workflow files that guide TFS Build through the process of executing a given build. The reason why your project is building locally is that Visual Studio isn't using this build template, as build templates only run on the server under TFS Build.

I dare say someone has customised the build template that your build is using, and that customisation is failing. Based on the error, it seems to be happening during the execution of a CodeActivity, which is now obsolete (though being obsolete isn't actually the issue). The custom code in that CodeActivity is probably failing though.

Assuming your build process doesn't need any specific customisations provided by the failing build template, I'd just select a different one or create a new one. You can do this from the Process tab when editing the build definition.

Hope this helps!

Share:
10,292
steveg89
Author by

steveg89

New

Updated on August 06, 2022

Comments

  • steveg89
    steveg89 almost 2 years

    I'm trying to get a project to work with a continuous integration build. Currently, it consists of a library dll, .net 4.5 app, and WP8 app. I use team foundation service with GIT as my source control.

    I was able to set up a build configuration but it fails with the following message:

    Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
    Exception Stack Trace:    at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
       at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
    

    This is the ONLY exception in the entire solution, although there are 10 warnings. Additionally, I've run the build with the verbosity to diagnostic and here is the output of that.

    Again I don't see any issues with that build, just the cryptic "Done building project.... --FAILED" message. Locally, the project can be built and rebuilt without any issues. Anyone have any idea what might be causing this issue?

    Edit: Through trial and error I've narrowed the issue down to having a windows phone 8 application in my solution. If I exclude that project, the solution builds fine. If it's included, I get the problem. Should I perhaps be using a separate build definition for each project and not for the solution itself? Windows phone 8 projects by themselves build fine...

  • steveg89
    steveg89 over 10 years
    I'll give it a try. This is a perfectly clean template other than a few flags. I changed the build processor to x86 so that Windows Phone would build properly, then I specified to build Release for Any CPU. I will try this when I get home. If it doesn't work, is there anything I can post that would help you narrow it down? Pics of the build setup perhaps?
  • Chris Anderson
    Chris Anderson over 10 years
    Do you have any other builds working successfully on this build server? Can you try creating a simple console app and getting the build server to build it using the same build template? That will prove whether or not it's the build template being the problem. You're building a WP8 app - do you have the SDK installed on the build server? Also, which version of TFS are you using? If TFS2010, you'll need the .NET Framework 4.5 installed on the build server.
  • steveg89
    steveg89 over 10 years
    This is all using team foundation service, so I'm not in control of the build server at all.
  • Chris Anderson
    Chris Anderson over 10 years
    Ah, OK. Well then I'd expect it would have all of this stuff installed then. Can you post the warnings you're getting please?
  • steveg89
    steveg89 over 10 years
    I'm at work but they are for assigning a variable to itself. It's definitely things that can be taken out, but I wouldn't think that would be necessary... There are 10 of those warnings.
  • Chris Anderson
    Chris Anderson over 10 years
    Hmm, OK. I'd try removing parts of your build to see if you can narrow down the issue to a particular project being built. For example, just try getting it to build your DLL. If that doesn't work, create a console app like I mentioned and get it to build that. Basically remove most things so it works (hopefully), then gradually add things back in until it fails, thus narrowing the issue down.
  • steveg89
    steveg89 over 10 years
    I'll work on that tonight and update my question with the results. Thank you for looking into this
  • Chris Anderson
    Chris Anderson over 10 years
    OK, I'm afraid I have to admit to being utterly flummoxed with this issue. The fact that you can build a WP8 project file on its own, but not in a solution with other projects is baffling. At least the issue has been identified now. I'd say it's a TFS bug given the info you've provided - I can't think of any other rational reason for that behaviour. If it's OK to use separate build definitions to build your projects then I think that's a solution for now. Create separate solutions for the build server, and keep the current one to use for dev.
  • Chris Anderson
    Chris Anderson over 10 years
    Also, report it as a bug on Connect and see what they say.
  • steveg89
    steveg89 over 10 years
    I know we didn't come to a real solution, but I'm going to give you the answer flag as someone else may be able to follow your steps to correct their issue.
  • Chris Anderson
    Chris Anderson over 10 years
    Thanks Steve :). Sorry to hear your issue still hasn't been resolved, but hopefully the problem will be solved in the near future.