Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

on-premises build agent is failing to build solution with projects on .net 4.7.1

We have recently upgraded some projects to .net framework 4.7.1 but our on premise build agent is failed to run the build solution build step. We are using Visual Studio Team Services.

The full error is...

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (1122, 5) C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1122,5): Error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

The build machine is a windows server 2016 azure VM with Visual Studio 2017, 15.4.4 installed. I manually installed the 4.7.1 .net framework sdk from here: https://docs.microsoft.com/en-us/dotnet/framework/whats-new/index#v471.

I've rebooted and restarted the agent service but still it failed with the above.

Any ideas how to resolve this issue?

The full build solution log file can be found here: Build solution log gist

Thanks,

like image 233
Konzy262 Avatar asked Nov 21 '17 17:11

Konzy262


1 Answers

It turned out the issue was due to not having the 4.7 SDK and 4.7 targeting pack checked under individual components in Visual Studio.

enter image description here

like image 160
Konzy262 Avatar answered Sep 22 '22 17:09

Konzy262