Fixing MSBuild CS1525, CS1003 Compiler Errors

· 1 min

Recently I needed to use MSBuild to compile a solution for a build server.

The MSBuild was located at:

C:\Program Files (x86)\MSBuild\14.0\Bin

The following errors were occurring despite this working in the past:

error CS1525: Invalid expression term 'decimal'
Syntax error, ',' expected
error CS1003: Syntax error, ',' expected [Web.csproj]

This was due to C# 6/7 features which aren’t supported by this version of MSBuild.

The Fix

Using this version of MSBuild resolved the issue:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin