6

I'm trying to do a teambuild for a VS2015 solution with TFS2013. On the buildserver VS2015 is installed and I changed the buildtemplate so msbuild has an argument \tv:14.0, but when a start a build I get the following error:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets (96): Invalid static method invocation syntax: "[Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion))". Method 'Microsoft.Build.Utilities.ToolLocationHelper.GetPlatformSDKDisplayName' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a, b)).

The buildserver has been restarted but I still get the error. I also checked this thread: Build failed in TFS but no real answer was given there. Is there anyone that knows how to solve this.

Community
  • 1
  • 1
Sebastian S
  • 285
  • 2
  • 16
  • Have you tried this? http://stackoverflow.com/questions/30361105/microsoft-build-utilities-toollocationhelper-error-on-teamcity – demokritos Nov 16 '15 at 13:45
  • 1
    I installed the sdk, but still no change. But when I look in the GAC there is an assembly Microsoft.Build.Utilities. And in that assembly there is no GetPlatformSDKDisplayName method in the ToolLocationHelper class. But in the folder C:\Program Files (x86)\MSBuild\14.0\bin there is a DLL Microsoft.Build.Utilities.Core and there is a GetPlatformSDKDisplayName for the class ToolLocationHelper. Could it be he somehow can't find the dll (name??) in the folder and default to the gac? – Sebastian S Nov 16 '15 at 15:47
  • @SebastianS, when customizing the build process template via modifying the MSBuild activity, please set the ToolPath to be "C:\Program Files (x86)\MSBuild\14.0\Bin". – Vicky - MSFT Nov 18 '15 at 05:55
  • 1
    I spent days looking into this same GetPlatformSDKDisplayName error when porting a VS2012 project to VS2015. It turns out that a tool used in our build process was referencing the Microsoft.Build assemblies for .NET: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\. I deleted them and browsed to C:\Program Files (x86)\MSBuild\14.0\Bin\ to add the MSBuild 14 versions instead. – thehelix Jan 26 '16 at 15:46
  • Sorry, I ran out of time to edit my comment above. I used Microsoft.Build.Utilities.Core in place of the old Microsoft.Build.Utilities assembly. They both use the Microsoft.Build.Utilities namespace so my code didn't have to change. – thehelix Jan 26 '16 at 15:53

2 Answers2

4

I was experiencing the exact same error. I determined that TFS2013 was the RTM version so we installed TFS2013 Update 5. Now if I run using the *.12.xaml process template with the /tv:14.0 /p:VisualStudioVersion=14.0 parameters the build succeeds. I have also made a copy of the *.12.xaml build process and named it *.14.xaml and changed the Run MSBuild steps ToolVersion property to "14.0" and this build works as well, without the parameters.

basmith
  • 56
  • 3
  • 1
    The person responsible for the TFS isn't willing to do the update. It's to risky for him (External party installed and configured TFS). This could indeed be the answer i'm looking for. Need more time to persuade him. thanks for the answer – Sebastian S Nov 20 '15 at 06:18
  • 1
    We did the upgrade and it worked. Thanks for the info – Sebastian S Jan 28 '16 at 06:17
  • We've installed update 5 on TFS 2013, but it still fails. Does any one have the same error after update? – Stanislav Mar 04 '16 at 09:47
0

You need to customize the build process template by finding all the Run MSBuild for Project MSBuild activity, then set the ToolVersion to "14.0" and set ToolPath to target to MSBuild14 (by default: "C:\Program Files (x86)\MSBuild\14.0\Bin"). After that, check in the build process template and re-queue the build.

Check the solutions here:TFS 2013 building .NET 4.6 / C# 6.0

Community
  • 1
  • 1
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • 1
    The problem I have is that the template i'm using (TfvcTemplate.12.xaml) doesn't include the activity **Run MsBuild for Project**, it only has **Run MSBuild** and I can't pass along the toolpath with that activity. I also can't seem to find other build templates. – Sebastian S Nov 18 '15 at 06:35
  • Then try to set MSBuild arguments to /tv:14.0, not \tv:14.0 – Cece Dong - MSFT Nov 18 '15 at 09:36