0

I'm setting up a new CI build server using TFS Build 2015 (XAML - I know I have to move to vNEXT.) and Visual Studio 2017.

My build is breaking with Invalid expression term '.'. The code that is problematic syntax is...

addVaultAction?.Invoke(this, vault)

If replaced with...

if (addVaultAction != null)
    addVaultAction.Invoke(this, valut)

... the CI build doesn't trip up.

The problematic code also compiles fine within Visual Studio 2017, but during the CI build (MSBuild) it fails.

Also, this code did exist on our previous build server which ran TFS Build 2015 and Visual Studio 2015 and the CI/MSBuild compiles completed successfully.

It would appear something is missing on my new build server. Does anyone know what that might be? Or is it that TFS 2015 and VS 2017 do not play nice together.

I've seen reference to making sure Microsoft.Net.Compilers is up to date but, if related to this problem at all, I don't know how or where to check on that.

Any help GREATLY appreciated!

Thanks!

1 Answers1

0

Invalid Expression Term '.' Running Visual Studio 2017 and TFS Build 2015

You can try to use MSBuild task to build your project and specify the MSBuild version to 15.0 or the latest, or specify the MSBuild 15.0 location with radio button Specify Location, like:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe

enter image description here

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Unfortunately, I'm still using XAML Build and not vNext. I'd like to begin work on moving to vNext, but don't really know how to start. I just posted another question on that. – Superfreak3 Jul 19 '18 at 13:15
  • @Superfreak3, Since you are still using XAML Build, you have to use old DefaultTemplate.11.1.xaml DOES to add the ToolPath property on the MSBuild elements: https://stackoverflow.com/a/47181623/5391065 – Leo Liu Jul 20 '18 at 07:48
  • Can I just use DefaultTemplate.11.1.xaml with TFS Build 2015 or do I have to work with an earlier version of TFS XAML Builds? If I can use the older file with TFS 2015, where can I get it? – Superfreak3 Jul 20 '18 at 14:17
  • @Superfreak3, please check the comment of PatrickLu for some more details. – Leo Liu Jul 23 '18 at 09:17