NuGet Error NU1201

Example 1

Project 'ProjectA' is not compatible with 'TargetFramework'. Project 'ProjectA' supports:
- 'TargetFrameworkA'
- 'TargetFrameworkB'

Issue

A dependency project doesn't contain a framework compatible with the current project. Typically, the project's target framework is a higher version than the consuming project.

Solution

Change the project's target framework to an equal or lower version than the consuming project.

Example 2 - NetStandard targetted projects cannot reference NetCoreApp targetted projects

Project 'ProjectB' is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project 'ProjectB' supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)

Issue

In this case:

  • ProjectA targets NetStandard 2.0
  • ProjectB targets NetCoreApp 2.0
  • ProjectA has a project reference to ProjectB

NetStandard projects can never depend on a NetCoreApp project.

Solution

Either:

  • change ProjectA to target NetCoreApp 2.0

or

  • change ProjectB to target NetStandard 2.0