I am using VS build task but failing with following error
##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1259,5): Error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets;linenumber=1259;columnnumber=5;code=MSB3644;]The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
Project "C:\azp\agent\_work\3\s\VeracodeDemo.sln" (1) is building "C:\azp\agent\_work\3\s\VeracodeDemo\VeracodeDemo.csproj" (2) on node 1 (default targets).
But the task which is run respective agent alrready configured with below dotent frame work versions

What is missing? Please suggest fix