[Solved] Error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found - Azure

Article Faysal Shuvo

Problem: 

For my builds, i have an Azure pipeline setup. Recently I am running into these issues: 

##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
\Microsoft.Common.CurrentVersion.targets(1220,5):
Error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found.

So in this article, we are going to talk about how to solve azurePipeline failing due to: The reference assemblies for .NetFramework, Version=v4.6.1 were not found.


Solution: 

Azure DevOps Microsoft-hosted agent has deprecated the .Net framework version 4.6.1. So you have two kinds of Microsoft-hosted agents: 

1. windows-2022: .Net framework 4.8 preinstalled, You can find documentation here

2. windows-2019: .Net framework version 4.7.2 and 4.8 preinstalled. You can find documentation here


and for .Net framework 4.6.1, you need to use a self-hosted agent. You can easily create this using official Self-hosted Windows agents documents


Hope this solves your problem. If not please comment below.