You are encountering a build error in Azure Devops due to missing .Net framework 4.6.1 developer pack.
from the logs:
The reference assemblies for .NETFramework,Version=v4.6.1 were not found.
This means the .Net framework 4.6.1 targeting pack is not installed on the build agent
Your script doesn’t fix because in your current install command you are including 4.5.2 but your project requires 4.6.1.
Solution:
Add the missing 4.6.1 developer pack component to your visual studio installation script
Update your install command with:
--add Microsoft.Net.Component.4.6.1.TargetingPack
So, your corrected block should include:
--add Microsoft.Net.Component.4.6.1.TargetingPack
In case you want to install it manually: