6

Severity Code Description Project File Line Suppression State Error NETSDK1005 Assets file 'D:\Working On\Gra\Gra\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v5.0'. Ensure that restore has run and that you have included 'netcoreapp5.0' in the TargetFrameworks for your project. Gra C:\Program Files\dotnet\sdk\5.0.100-preview.1.20155.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234

I've just create ASP.NET Core Web Application, and then when I run, I it's show message errors!

9
  • You can use .net core 3.1. Any specific use case to use .net 5 perview? or is it just for learning purpose? Commented Sep 20, 2020 at 14:03
  • For any specific use case and Long term project. Commented Sep 20, 2020 at 15:05
  • 1
    @RajdeepDebnath it's not a Preview, it's a fully supported RC with a Go Live license. There are no build problems Commented Sep 21, 2020 at 9:22
  • He is using preview as mentioned in the error C:\Program Files\dotnet\sdk\5.0.100-preview.1.20155.7\Sdks\Microsoft.NET.Sd Commented Sep 21, 2020 at 9:27
  • netcoreapp5.0 there's no such target. It's net5.0. Did you edit the csproj manually perhaps? Or use an outdated SDK? Install the latest .NET 5 SDK and just create a new project, eg dotnet new web or dotnet new webapp Commented Sep 21, 2020 at 9:28

4 Answers 4

15

In my publish profile the Target Framework was set to NET5.0. Changed it to NET6.0 and the problem was gone.

Sign up to request clarification or add additional context in comments.

Comments

12

Update to Nuget 5.8 Clear the local cache

error NETSDK1005: Assets file 'project.assets.json' ....

Try updating NuGet.exe to the 5.8.0 version or above:

nuget update -self

if you prefer to update the nuget version in Visual Studio, just follow this steps. Then, clear NuGet cache:

dotnet nuget locals all --clear

Download Nuget

found here

2 Comments

Updating Nuget to latest (5.8) resolved compilation in VS 2019 (I do not use VS 2019 Preview) for a simple .Net 5.0 console app. Thanks.
Fixed it for me on an Azure Devops pipeline that had a 'Use Nuget' pipeline stage.
8

Delete the 'obj' folder and re-build the project.

Comments

1

You're using an extremely old .NET 5 preview. ASP.NET Core Preview 1 specifically had no new features, it was essentially a version number change. There's no netcoreapp5.0 framework target any more, it's net5.0.

The latest version is 5.0 RC1 which is feature-complete and supported in production. Install it and create a new project with, eg dotnet new webapp or dotnet new webapi etc.

This version is supported by the latest Visual Studio 2019 Preview version.

1 Comment

Thanks @Panagiotis Kanavos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.