locked
How to upgrade build (XAML) from 2013.4 to 2015 RRS feed

  • Question

  • We have a large number of build definitions running on 2013.4 build servers (with TFS and VS installed) so I have started to get it working with 2015 RC to prepare for the actual release. Over time we have made a lot of changes to the flow (originally from 2010) and added various custom code (all .Net 4.5.1) and xaml activities, so it is little monster that I am trying to upgrade.

    I installed TFS+VS 2015 RC on a blank server and made a copy of the flow and activities so I can work independenly of the production system. I haven't however gotten past the first error I saw when queuing a build:

    TF215097: An error occurred while initializing a build for build definition \MyProject\TFSandVS2015TestBuild: Exception Message: The type ‘InArgument(wba:BuildOutputFolder)’ of property ‘OutputFolder’ could not be resolved. (type Exception)Exception Stack Trace:    at Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(String workflowXaml, TextExpressionImports textExpressionImports)   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext)   at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)

    Looking at my custom activities solution, I discovered at least the two following issues:

    1. A few of the projects were referencing specific 12.0.0.0 TFS assemblies - this was easily fixed, although I now see a conflict warning for some of the TFS assemblies.

    2. There seems to be missing a few TFS assemblies, specifically the following three

    Microsoft.TeamFoundation.Build.Client

    Microsoft.TeamFoundation.Build.Workflow

    Microsoft.VisualStudio.Services.Common

     

    I am a bit stuck on what to try next - has anyone seen the issues first hand and managed to get past them? What about an upgrade guide that might help me on the way? All suggestions are welcome!


    Tore Østergaard
    Oticon A/S, Denmark

    Tuesday, May 19, 2015 1:04 PM

Answers

  • I have managed to solve the issues seen when editing the process part of the build definition. The cause of the problem was the enum BuildOutputFolder which is in a custom assembly that referenced a number of TFS assemblies. This enum is used by our customized build process template.

    Solution for me was to add the needed TFS assemblies to the custom assemblies folder. After adding the first, it complained about a new one, so I just continued to add until it was satisfied. I needed to add the following assemblies:

    Microsoft.TeamFoundation.Build.Client.dll
    Microsoft.TeamFoundation.Client.dll
    Microsoft.TeamFoundation.Common.dll
    Microsoft.TeamFoundation.Diff.dll
    Microsoft.TeamFoundation.VersionControl.Client.dll
    Microsoft.TeamFoundation.VersionControl.Common.dll
    Microsoft.VisualStudio.Services.Common.dll

    It didn't result in the missing MsBuild.exe as described earlier, so now everything seems to Work.


    Tore Østergaard
    Oticon A/S, Denmark

    • Marked as answer by 2re Thursday, October 15, 2015 10:55 AM
    Friday, July 3, 2015 10:48 AM

All replies

  • Hi Tore,

    In general, you have to build the solution successfully with MSBuild locally or build it on your build agent machines before TFS build since TFS build use MSBuild as its default. If you use the build process template of TFS 2015 RC, it would be better to test it in your test environment.

    For the issue, you might not add the needed custom assemblies under source control. And you can add the path to custom assemblies in properties of build controller. Check this blog for more information.  Or click refresh in process tab of build definition to refresh the build process template. If you have any other issues, you can set the logging verbosity to diagnostic to check the detailed build log.

    Best regards,

    Wednesday, May 20, 2015 2:25 AM
    Moderator
  • Hi Charles-Li

    Thanks for your reply.

    Solution can build locally on a machine with only 2015 RC, but the build hasn't gotten that far yet - It fails on initializing the flow.

    The custom assemblies have been added to source control and the controller points to them.

    I can refresh the build process template without any errors - again on a machine with only 2015 RC.

    Verbosity is set to Diagnostics.


    Tore Østergaard
    Oticon A/S, Denmark

    Wednesday, May 20, 2015 7:10 AM
  • Hi Tore,

    In this situation, your project might reference assemblies/components that accompany with Visual Studio 2015 RC. You can try it on your build agent machine or install Visual Studio 2015 RC if you haven't.

    Since TFS 2015 version is RC but not released, it's not suggested to use TFS 2015 RC on production server.

    Best regards,

    Wednesday, May 20, 2015 8:57 AM
    Moderator
  • Hi Charles-Li

    Visual Studio 2015 RC is installed on the build server together with TFS Xaml Build. It is a clean a separate server so I am not messing up my production system.

    But, according to Brian Harry the RC's are go-live so there should be no problem using them for production. http://blogs.msdn.com/b/bharry/archive/2015/04/29/visual-studio-and-team-foundation-server-at-build-2015.aspx

    I have just run a build+analysis+test using the default template and that worked as expected.


    Tore Østergaard
    Oticon A/S, Denmark

    Wednesday, May 20, 2015 10:50 AM
  • hi Tore,

    as TFS 2015 can use build server from TFS 2013 I would recommand to configure TFS 2013 build server and connect to them as you've customized XAML build template.


    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Wednesday, May 20, 2015 11:50 AM
  • Hi Daniel

    That is also an option, but I figured that when I was installing new servers anyway that it would be best to skip 2013 completely and go for a clean 2015 installation.

    Just to keep things up-to-date.


    Tore Østergaard
    Oticon A/S, Denmark

    Wednesday, May 20, 2015 12:14 PM
  • Hi Tore,

    I work on the TFS Build team. I am not sure what is happening, but I would like to help. The only major change to XAML builds in 2015 is that the Object Model dlls that used to be GACed are now not GACed. What that means is that you may have to copy them locally for local builds to work.

    Do your custom assemblies build locally inside VS2015 when linked to the 2015 versions of all assemblies?

    Are you sure that no TFS assemblies are in your custom assembly path?

    Have you tried turning on Fusion Log to see why the assemblies can't be loaded?

    Thanks,

    Jason

    Wednesday, May 20, 2015 5:43 PM
  • Hi Jason

    Thanks for your feedback.

    No the custom assemblies does not build currently, because of the two missing assemblies. I'll see if that can be explained by them not being GACed. But I guess that the solution would then be adding them to the custom assembly path, or?

    I did run Fusion Log earlier, but didn't get anything. I'll give it another try.

    I'll get back with Progress later today.


    Tore Østergaard
    Oticon A/S, Denmark

    Thursday, May 21, 2015 9:31 AM
  • Hi Jason

    I have gotten a bet further in the hunt, based on your input. I have copied the following dll's locally and added a hintpath to their referees. I still have some conflict warnings, as the compiler seems to preferr the 11.0/12.0 versions where nothing is specified. I'll look at those later.

    Microsoft.TeamFoundation.Build.Activities.dll
    Microsoft.TeamFoundation.Build.Client.dll
    Microsoft.TeamFoundation.Build.Workflow.dll
    Microsoft.TeamFoundation.Client.dll
    Microsoft.TeamFoundation.Common.dll
    Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll
    Microsoft.TeamFoundation.TestImpact.Client.dll
    Microsoft.TeamFoundation.VersionControl.Client.dll
    Microsoft.TeamFoundation.VersionControl.Common.dll
    Microsoft.VisualStudio.Services.Common.dll

    This leaves me with one (actual) build error:

    Severity Code Description Project File Line
    Error  Extension 'Microsoft.Activities.Build.Validation.ValidationBuildExtension' threw an exception of type 'System.Activities.InvalidWorkflowException' :  'The following errors were encountered while processing the workflow tree:
    'VisualBasicValue<Workspace>': Compiler error(s) encountered processing expression "Workspace".
    'Workspace' is not declared. It may be inaccessible due to its protection level.

    'VisualBasicReference<String>': Compiler error(s) encountered processing expression "localProjectPath".
    'localProjectPath' is not declared. It may be inaccessible due to its protection level.

    'VisualBasicValue<String>': Compiler error(s) encountered processing expression "ProjectPath".
    'ProjectPath' is not declared. It may be inaccessible due to its protection level.
    '. ActivityLibrary C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets 347

    I will continue tomorrow, but if you have an idea on the above error, then do tell.


    Tore Østergaard
    Oticon A/S, Denmark

    Thursday, May 21, 2015 2:47 PM
  • Hi Tore,

    The workspace class is in the VersionControl.Client assembly. I am not sure why it is not finding it. It sounds like you are on the right path. If you can't get past it, I will pass along my email address and you can send the code to me to try (if you want).

    Thanks,

    Jason

    Thursday, May 21, 2015 3:22 PM
  • Hi Jason

    Got a lot further now. The errors mentioned above disappeared when fixing the last reference warnings. I now have one error left, but it is in the project with the only purpose of including the Build Process Template. The error is:

    Extension 'Microsoft.Activities.Build.Validation.ValidationBuildExtension' threw an exception of type 'System.Activities.InvalidWorkflowException' :  'The following errors were encountered while processing the workflow tree:
    'VisualBasicReference<IBuildDetail>': Compiler error(s) encountered processing expression "BuildDetail".
    'BuildDetail' is not declared. It may be inaccessible due to its protection level.

    Committing the changes lets the build get furher than earlier, but I now get error during the get operation:

    D:\MyFile.cs: Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O).

    I will continue my quest. Input still welcome.


    Tore Østergaard
    Oticon A/S, Denmark

    Friday, May 22, 2015 10:55 AM
  • Hi Tore,

    If you use TFS 2013 build controller, you can try the methods as below to check if they're helpful:

    1. Upgrade to your build controller to TFS 2015 build controller

    2. Downgrade to use TFS 2013 build process template

    Also check if this blog helps to your problem.

    Best regards,

    Monday, May 25, 2015 6:27 AM
    Moderator
  • Hi Charles-Li

    1. I am already using a TFS 2015 RC build controller/agent with Visual Studio 2015 RC installed.

    2. I am trying to get my own custom process template working. It is based on the one from 2010, but was refined to work on 2013. Using the build-in process template from 2013 works like a charm, as I would have expected, but don't offer the functionality that is the base for our customizations.


    Tore Østergaard
    Oticon A/S, Denmark

    Friday, May 29, 2015 8:07 AM
  • Hi Jason and others

    The error during the get operation was only a one-time deal, so that is off the table.

    Next I saw was a warning about missing Nuget.exe:

    Unable to restore NuGet packages. Details: NuGet.exe was not found in the expected location: C:\Users\SA_KBN_TBS\AppData\Local\Temp\BuildAgent\126\Assemblies\nuget.exe

    This was solved by moving the TFS reference assemblies out of the custom assemblies folder. I think that you mentioned this earlier, but I didn't understand it until I read this one: http://geekswithblogs.net/jakob/archive/2014/05/07/tfs-build-nuget.exe-was-not-found-in-the-expected-location.aspx

    With that solved I have a few errors about missing MSBuild.exe:

    Exception in build File not found: MSBuild.exe System.IO.FileNotFoundException: File not found: MSBuild.exeFile name: 'MSBuild.exe' ---> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.ProcessWrapper.Start()Server stack trace:    at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.ProcessWrapper.Start()   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.InvokeProcessInternal.RunCommand(AsyncState state)   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)   at System.Func`2.EndInvoke(IAsyncResult result)   at System.Activities.AsyncCodeActivity`1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

    It seems related to the Nuget.exe problem, but I am looking into that now. More information will follow when I will hopefully see progress.


    Tore Østergaard
    Oticon A/S, Denmark

    Friday, May 29, 2015 8:18 AM
  • Sorry for the month of silence. It turned out that the error with msbuild above was caused by running the build on the wrong controller (one with TFS/VS 2013). Stupid mistake from my side!

    So now I can build and run unit test on a TFS/VS 2015 RC build server!

    What is left is some small problems that I have ignored along the way. When opening the process template I get the following:

    Summary: There were 0 failures, 2 errors and 0 warnings loading custom activities and services.
    Error: Method 'Initialize' in type 'My.Build.Utilities.MemoryLogger' from assembly 'MsBuildRunner, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
    Error: Could not load file or assembly 'Microsoft.TeamFoundation.Build.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    The parameter OutputFolder could not be loaded because the type InArgument<Wdh.Build.Activities.BuildOutputFolder> was not found.
    

    I am continuing the quest, but let me know if you have suggestions on what to do.


    Tore Østergaard
    Oticon A/S, Denmark

    Friday, June 26, 2015 10:57 AM
  • Managed to get the first error solved. Our MemoryLogger did have the Initialize method, but for some reason the runtime didn't find it. Changing from inheriting from the abstract Microsoft.Build.Utilities.Logger to implementing Microsoft.Build.Framework.ILogger. Still don't know why, but now it works.

    Next problem, the missing Microsoft.TeamFoundation.Build.Client might have something to do with the TFS assemblies no longer being added to the GAC. Any thoughts here, Jason? How should the build definition editor be able to load the TFS assemblies?


    Tore Østergaard
    Oticon A/S, Denmark

    Friday, June 26, 2015 1:56 PM
  • Hi Tore,

    For the problem of missing Microsoft.TeamFoundation.Build.Client, your project might trying to use a 32-bit dll in a 64-bit environment. You can set the Platform Target property for the project to x86 to have a try.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 30, 2015 7:23 AM
    Moderator
  • Hi Charles-Li

    I am a bit unsure how to do that as I am getting the error when changing to the process tab on editing a build definition. All my custom assemblies are built for x86.


    Tore Østergaard
    Oticon A/S, Denmark

    Tuesday, June 30, 2015 7:40 AM
  • I have managed to solve the issues seen when editing the process part of the build definition. The cause of the problem was the enum BuildOutputFolder which is in a custom assembly that referenced a number of TFS assemblies. This enum is used by our customized build process template.

    Solution for me was to add the needed TFS assemblies to the custom assemblies folder. After adding the first, it complained about a new one, so I just continued to add until it was satisfied. I needed to add the following assemblies:

    Microsoft.TeamFoundation.Build.Client.dll
    Microsoft.TeamFoundation.Client.dll
    Microsoft.TeamFoundation.Common.dll
    Microsoft.TeamFoundation.Diff.dll
    Microsoft.TeamFoundation.VersionControl.Client.dll
    Microsoft.TeamFoundation.VersionControl.Common.dll
    Microsoft.VisualStudio.Services.Common.dll

    It didn't result in the missing MsBuild.exe as described earlier, so now everything seems to Work.


    Tore Østergaard
    Oticon A/S, Denmark

    • Marked as answer by 2re Thursday, October 15, 2015 10:55 AM
    Friday, July 3, 2015 10:48 AM