I tried manually copying the files msvcr120.dll and SqlServerSpatial140.dll to the 64 bit and 32 bit Windows directories (C:\Windows\SysWOW64 and C:\Windows\System32) but this did not work.
What worked for me was to install the Microsoft System CLR Types for SQL Server 2017 on the machine in both x86 and x64 versions.
Without that I would continue to see the following MSBUILD errors...
"ResolveAssemblyReferences:
Primary reference "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL".
9>C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors."
Considered "SqlServerTypes\x64\msvcr120.dll", but its name "msvcr120" didn't match.
Considered "SqlServerTypes\x64\SqlServerSpatial140.dll", but its name "SqlServerSpatial140" didn't match.
Considered "SqlServerTypes\x86\msvcr120.dll", but its name "msvcr120" didn't match.
Considered "SqlServerTypes\x86\SqlServerSpatial140.dll", but its name "SqlServerSpatial140" didn't match.
For SearchPath "{HintPathFromItem}".
Considered "..\packages\Microsoft.SqlServer.Types.14.0.314.76\lib\net40\Microsoft.SqlServer.Types.dll", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL", which was not found in the GAC."
This combination resolved the issue...
Confirm the Microsoft.SqlServer.Types Assembly Name is listed in the assembly cache at:
C:\WINDOWS\assembly\
or in: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.Types\
I installed the Microsoft.SqlServer.Types nuget package to the project
I added the SqlServerTypes folder that was created by the nuget package installation including the x64 and x86 folder contents to source control (msvcr120.dll and SqlServerSpatial140.dll)
For both msvcr120.dll and SqlServerSpatial140.dll change the File Property "Copy to Output directory" to "Copy always"
Finally the following configuration key was added to the app.config for the project.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0" newVersion="14.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>