Frame work error

tarun k 555 Reputation points
2025-08-01T04:56:26.2066667+00:00

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 respective machine alrready configured with below dotent frame work versions

User's image

What is missing? Please suggest fix

Developer technologies | .NET | Entity Framework Core
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Adiba Khan 245 Reputation points Microsoft External Staff
    2025-08-01T10:09:50.9966667+00:00

    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:

    .NET - Build modern apps and powerful cloud services


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.