0
votes

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!

3
You can use .net core 3.1. Any specific use case to use .net 5 perview? or is it just for learning purpose? - Rajdeep Debnath
For any specific use case and Long term project. - lamboktulus1379
@RajdeepDebnath it's not a Preview, it's a fully supported RC with a Go Live license. There are no build problems - Panagiotis Kanavos
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 - Rajdeep Debnath
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 - Panagiotis Kanavos

3 Answers

5
votes

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

3
votes

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

1
votes

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.