Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core Web API 5.0 build errors

Tags:

.net-5

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!

like image 229
lamboktulus1379 Avatar asked Aug 22 '26 16:08

lamboktulus1379


2 Answers

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

like image 139
KnuturO Avatar answered Aug 26 '26 22:08

KnuturO


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

like image 21
Manfred Wippel Avatar answered Aug 26 '26 22:08

Manfred Wippel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!