LohithML
LohithML

Reputation: 21

Package [some package] is not compatible with netcoreapp

I recently installed Visual Studio 2017. I migrated the existing project which created in Visual Studio 2015. It got migrated without any errors. But when I build the solution I get 100+ errors stating Package [Microsoft.AspNetCore...] is not compatible with [netcoreapp...]

There are more than 100 items listed like this. I tried renaming the sdk value in global.json removing sdk value in global.json repair, uninstall & reinstalling Visual Studio 2017. But none of them work.

I'm not sure where to add net451 in imports as explained here because the project.json file is deleted while migration.

The same project was working fine in Visual Studio 2015. All issues started after migrating to Visual Studio 2017.

Please let me know how to fix this error.

Upvotes: 2

Views: 9926

Answers (3)

boatcoder
boatcoder

Reputation: 18107

If you are coming here after VStudio 2019 and you can't install the upgrade-assistant to get you to .net 5, upgrade your Visual Studio to 16.9+

Upvotes: 0

Arash Yazdani
Arash Yazdani

Reputation: 302

You have to do this solution

  1. open menu>project>'your project name'proprties...

  2. in the opened window Application Tab change 'Target Framework' combo to '.Net Core 2.0'

  3. now close the window and update again

enjoy it:)

Upvotes: 1

Travis Boatman
Travis Boatman

Reputation: 2282

Due to your last comment I believe your problem is with the Nuget cache. I've seen this before where Nuget is pulling older packages after updating to .NET Core Tooling RTM and or VS 2017. To fix this run dotnet nuget locals --clear all. Then try creating a new .NET Core project.

Upvotes: 6

Related Questions