question

jcmanke avatar image
1 Vote"
jcmanke asked alind-1448 published

NETSDK1005 error building .NETStandard 2.0 project on Azure DevOps

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: https://github.com/actions/virtual-environments/blob/win19/20201116.1/images/win/Windows2019-Readme.md
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 4.8.0.03761 the build succeeds.

dotnet-runtimedotnet-standard
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @jcmanke , thank you for taking time to post this issue in Microsoft Q&A forum. It seems this issue is related to Azure DevOps and .NET, as you know, our forum(Microsoft Q&A vs-msbuild) is about the usage of MSBuild, build customization and MSBuild extensibility via tasks, loggers and hosting, so I will help to move the vs-msbuild tag.

Besides, as DSPatrick suggested, you can post questions about Azure DevOps in Developer Community azure devops and StackOverflow tagged with azure-devops, and you can get more professional help there. Have a nice day:)


0 Votes 0 ·
jcmanke avatar image
5 Votes"
jcmanke answered alind-1448 published
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

using nuget 5.8.0 fixes the problem as well

2 Votes 2 ·

Thank you! <3

0 Votes 0 ·

Using NuGet 5.8 in my pipeline fixed the issue for me.

0 Votes 0 ·

updating to 5.8.0 solve the issue. thanks

0 Votes 0 ·
DSPatrick avatar image
1 Vote"
DSPatrick answered DSPatrick commented

The product group for Azure DevOps actively monitors questions over at
https://developercommunity.visualstudio.com/spaces/21/index.html

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




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, cross-posted it there.

0 Votes 0 ·

You're welcome.

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


0 Votes 0 ·