New to the forum as rookie, might ask something simple, please help me.
Running a yml pipeline by using a self hosted ado agent (Server 2019 data centre image). the dotnet build kees failing with the below error:
Build FAILED.
C:\agent_work_tool\dotnet\sdk\6.0.300\Microsoft.Common.CurrentVersion.targets(1221,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [C:\agent_work\3\s\xxxxxxxx.xxxxxxxx.Tests.Api\xxxxxxxx.xxxxxxxx.Tests.Api\xxxxxxxx.xxxxxxxx.Tests.Api.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.40
I have checked the self hosted agent and make sure that dotnet 5 and 6 are both installed. still not working. tried almost everything but no luck.VS2022 is also installed (2017 and 2019 are installed parallel as well)
The reason we are using the self hosted agent is that the test task after build is needing to access some private endpint.