I am seeing an issue when building in Azure DevOps on my own build VM. Same error occurs on a VS2017 hosted agent.
Building a csproj (happens when targeting the solution file too) of a .Net Framework 4.6.1 project. It has references to .Net Framework 4.6.1 projects.
In the build log I am seeing
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): error : Project '..\MyNetFrameworkReferencedProject.csproj' targets 'netcoreapp2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.1'. [C:\temp\vsts-2.150.2_work\10\s\TheNetFrameworkProjectIAmTryingToBuild.csproj ]
Here is my build step
The same error occurs 5 times for each other .Net Framework 4.6.1 project reference
Nothing in the erroring projects packages.json suggest they are targeting any netcore packages
Any idea what I should check next?
Edit --
Running with debugging on I am seeing this error
##[debug]Exit code: 1
##[debug]Error record:
##[debug]Invoke-VstsTool : Process 'msbuild.exe' exited with code '1'.
##[debug]At C:\temp\vsts-2.150.2\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.0\ps_modules\MSBuildHelpers\InvokeFunctions.ps1:115 char:13
##[debug]+ Invoke-VstsTool -FileName $MSBuildPath -Arguments $argume ...
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-VstsTool
##[debug]
##[debug]Script stack trace:
##[debug]at Invoke-Tool, C:\temp\vsts-2.150.2\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.0\ps_modules\VstsTaskSdk\ToolFunctions.ps1: line 110
##[debug]at Invoke-MSBuild, C:\temp\vsts-2.150.2\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.0\ps_modules\MSBuildHelpers\InvokeFunctions.ps1: line 115
##[debug]at Invoke-BuildTools, C:\temp\vsts-2.150.2\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.0\ps_modules\MSBuildHelpers\InvokeFunctions.ps1: line 38
##[debug]at <ScriptBlock>, C:\temp\vsts-2.150.2\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.151.0\VSBuild.ps1: line 79
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]Microsoft.PowerShell.Commands.WriteErrorException: Process 'msbuild.exe' exited with code '1'.
##[error]Process 'msbuild.exe' exited with code '1'.
I can take the MSBuild command minus the central logger and it will run successfully directly on the Build VM
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe" "C:\temp\vsts-2.150.2_work\10\s\MyProject.csproj" /nologo /nr:false /p:Version=0.1.31 /p:OutputPath="bin\release" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0" /m /p:_MSDeployUserAgent="VSTS_AGUID_build_9_0"