Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package X is not compatible with netcoreapp3.1

I'm trying to run my .net core 3.1 project in VS 2019 but I'm getting errors like a below during building.

Severity Code Description Project File Line Suppression State Error NU1202 Package System.Diagnostics.DiagnosticSource 4.5.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package System.Diagnostics.DiagnosticSource 4.5.0 does not support any target frameworks. WebApi.Base C:\Users\ilyas.varol.TEST\source\repos\performancemanagementprojects\WebApi.Base\WebApi.Base.csproj

Notes:

  • I made reinstalling all packages and .net core 3.1 sdk
  • The same project is running in another computer

UPDATE

I still haven't solve my problem. Therefore I want to elaborate my question with screenshots. I hope someone can help me.

Error list enter image description here

Nuget Package Manager > Consolidate

enter image description here

like image 625
ilyas varol Avatar asked Sep 02 '25 16:09

ilyas varol


1 Answers

First, clean nuget caches or delete all files under C:\Users\xxx(current user)\.nuget\packages.

Then, delete bin and obj folder.

Rebuild the project to test again.

like image 83
Mr Qian Avatar answered Sep 05 '25 05:09

Mr Qian