microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 866 forks source link

Installing Visual Studio Test Agent 2017 removes MSBuild capability #902

Closed CodeCasterNL closed 7 years ago

CodeCasterNL commented 7 years ago

Agent version and platform

Agent 2.112.0 on Windows Home Server 2011 (don't ask).

VSTS type and version

TFS 2017 Express Update 1 on-premise. Also installed the following products:

In that particular order. All three having version number 15.0.26228.12.

What's not working?

Building using the "Visual Studio Build" step set to using either "Latest" or "Visual Studio 2017".

The agent doesn't detect the MSBuild_x64 capability, because it's selecting the "Visual Studio Test Agent 2017" as Visual Studio installation directory, which is the only one of the three that doesn't include MSBuild.

See VisualStudioFunctions.ps1 line 160.

Agent and Worker's diag log

[2017-04-05 21:16:41Z INFO PowerShellCapabilitiesProvider] STDOUT: Adding Visual Studio setup helpers.
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Getting Visual Studio setup instances.
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Found 3 instances.
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Description   : The Visual Studio Build Tools allows you to build native and ma
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT:                 naged MSBuild-based applications without requiring the Visual S
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT:                 tudio IDE. There are options to install the Visual C++ compiler
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT:                 s and libraries, MFC, ATL, and C++/CLI support.
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: DisplayName   : Visual Studio Build Tools 2017
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Id            : 2652b0da
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: InstallDate   : System.Runtime.InteropServices.ComTypes.FILETIME
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Name          : VisualStudio/15.0.0+26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Path          : C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Version       : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: VersionString : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Description   : Free, fully-featured IDE for students, open-source and individu
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT:                 al developers
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: DisplayName   : Visual Studio Community 2017
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Id            : e29354c5
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: InstallDate   : System.Runtime.InteropServices.ComTypes.FILETIME
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Name          : VisualStudio/15.0.0+26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Path          : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Version       : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: VersionString : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Description   : Supports running automated tests and load tests remotely
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: DisplayName   : Visual Studio Test Agent 2017
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Id            : e40991e6
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: InstallDate   : System.Runtime.InteropServices.ComTypes.FILETIME
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Name          : VisualStudio/15.0.0+26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Path          : C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Version       : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: VersionString : 15.0.26228.12
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: 
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Testing leaf: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\MSBuild\15.0\Bin\MSBuild.exe'
[2017-04-05 21:16:42Z INFO PowerShellCapabilitiesProvider] STDOUT: Does not exist.
ericsciple commented 7 years ago

A workaround is to use the MSBuild task and specify the path to msbuild

ericsciple commented 7 years ago

Currently the agent doesn't distinguish between multiple side-by-side installs of VS 2017. Fwd'ing along to appropriate folks so they can consider the scenario and plan according. This is feature level work, not bug fix. Closing the issue here since we don't track the backlog here.

Let me know if I've missed something, but that sounds like the root of the problem (doesn't support side-by-side VS 2017 gracefully, just picks one).

IanKemp commented 7 years ago

@CodeCasterNL I bet if you look at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7\15.0 you'll find the value is set to the TestAgent install directory. Edit that to point to the BuildTools directory and you should be golden.

@ericsciple I feel like this issue is caused by the fact that Test Agent is completely standalone - why can't it be included as a component of the Build Tools installer? In other words, why do I have to install Build Tools and Test Agent to separate directories, and then fiddle with the registry, to get both MSBuild and VSTest on the same machine? Why can't I just have a single Visual Studio install directory that has them both?

I appreciate that this may not be the best place to raise this issue; if so, I'd appreciate if you could direct me somewhere more appropriate.

ericsciple commented 7 years ago

@vijayma @chrisrpatterson regarding the VS install details provided by @IanKemp in the post immediately above. Any convenient option being overlooked? Or is this feedback for VS folks?