1
votes

I am setting up a new TeamCity agent based on Windows Server 2012 R2 Standard. I am adding scripts to install Visual Studio 2017 build tools.

I have an issue with the building of our project:

MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WCF\Microsoft.VisualStudio.ServiceModel.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

This is the script that I use to install the build tools:

@echo off

echo Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools

echo Microsoft.VisualStudio.Workload.MSBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.MSBuildTools

echo Microsoft.VisualStudio.Workload.NetCoreBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.NetCoreBuildTools

echo Microsoft.VisualStudio.Workload.VCTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.VCTools

echo Microsoft.VisualStudio.Workload.WebBuildTools
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.WebBuildTools
1

1 Answers

1
votes

Ok, figured this out. Needed to add one optional component:

echo Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup