tag:help.appveyor.com,2012-11-13:/discussions/problems/29884-byoc-msbuild-tools-is-missing-the-web-and-wcf-componentsAppVeyor: Discussion 2021-09-21T21:03:06Ztag:help.appveyor.com,2012-11-13:Comment/493034222021-07-22T12:56:16Z2021-07-22T12:56:16ZBYOC. MSBuild Tools is missing the Web and WCF components<div><p>When building the BYOC image you can select the option to install Visual Studio 2019 Test Agent and Build Tools<br>
However the install of the Build tools doesnt include any of the Web/WCF components.</p>
<p>error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0\<br>
WCF\Microsoft.VisualStudio.ServiceModel.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0\WCF\Microsoft.Visual<br>
Studio.ServiceModel.targets" is correct, and that the file exists on disk.</p>
<p>Can the deployment script be extended to include these components e.g.</p>
<p>vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.WebBuildTools<br>
vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup</p></div>matt_mckinstrytag:help.appveyor.com,2012-11-13:Comment/493034222021-07-22T14:10:55Z2021-07-22T14:11:48ZBYOC. MSBuild Tools is missing the Web and WCF components<div><p>Found a way to install it in the Build script but would be much nicer if it was already built into the image as its just more wasted build time</p>
<pre>
<code>$msbuildWCFComponentPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0\WCF"
if(-not (Test-Path $msbuildWCFComponentPath)) {
Write-Host "Install MSBuild Components" -BackgroundColor DarkMagenta -ForegroundColor White
$exePath = "$env:TEMP\vs_BuildTools.exe"
(New-Object Net.WebClient).DownloadFile('https://download.visualstudio.microsoft.com/download/pr/1e5ff7fe-162b-4a3d-8fda-3267702b551d/e25ce34fd81235ebbd79010afad8e63f/vs_buildtools.exe', $exePath)
cmd /c start /wait $exePath --add Microsoft.VisualStudio.Workload.WebBuildTools --add Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup --passive --norestart
del $exePath
}</code>
</pre></div>matt_mckinstrytag:help.appveyor.com,2012-11-13:Comment/493034222021-07-22T19:04:09Z2021-07-22T19:04:09ZBYOC. MSBuild Tools is missing the Web and WCF components<div><p>AppVeyor-BYOC module has been <a href="https://github.com/appveyor/build-images/commit/075fb02f8d1f599063cec28183c0d7519c603f4a">updated</a> with these 2 components: <a href="https://www.powershellgallery.com/packages/AppVeyorBYOC/1.0.176">https://www.powershellgallery.com/packages/AppVeyorBYOC/1.0.176</a></p></div>Feodor Fitsner