NETSDK1005 error building .NETStandard 2.0 project on Azure DevOps

Joe Manke 1,091 Reputation points

Doing continuous integration builds using a hosted agent in Azure DevOps, I now have builds failing with error NETSDK1005. Microsoft documentation notes this as a known issue that occurs when using preview versions of .NET 5 and Visual Studio 16.8, but I assume hosted agents should be using stable versions.

This is the error message from the logs (repeated for several projects):

[error]C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file 'D:\a\1\s\PROJECTNAMEHERE\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project.

Build agent information from the logs:

2020-11-20T19:32:33.0530259Z ##[section]Starting: Initialize job
2020-11-20T19:32:33.0531868Z Agent name: 'Azure Pipelines 4'
2020-11-20T19:32:33.0532328Z Agent machine name: 'fv-az686-598'
2020-11-20T19:32:33.0532610Z Current agent version: '2.177.1'
2020-11-20T19:32:33.0827960Z ##[group]Operating System
2020-11-20T19:32:33.0828375Z Microsoft Windows Server 2019
2020-11-20T19:32:33.0828593Z 10.0.17763
2020-11-20T19:32:33.0828796Z Datacenter
2020-11-20T19:32:33.0828984Z ##[endgroup]
2020-11-20T19:32:33.0829210Z ##[group]Virtual Environment
2020-11-20T19:32:33.0829452Z Environment: windows-2019
2020-11-20T19:32:33.0829696Z Version: 20201116.1
2020-11-20T19:32:33.0830062Z Included Software:
2020-11-20T19:32:33.0830714Z ##[endgroup]

When I build the same codebase in the same configuration on my personal machine with Visual Studio 16.7.7 and .NET Framework the build succeeds.

Microsoft Technologies based on the .NET software framework.
3,323 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,117 questions
{count} vote

Accepted answer
  1. Joe Manke 1,091 Reputation points
    5 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Dave Patrick 426K Reputation points MVP

    The product group for Azure DevOps actively monitors questions over at

    --please don't forget to Accept as answer if the reply is helpful--

    2 people found this answer helpful.

  2. Johnny Marcos 1 Reputation point


    Funciono con agregando en versión de nuget para instalar.


    0 comments No comments