Search code examples
c#portable-class-library

How to resolve error: The targets of Portable Library project are not the same or compatible with the targets of the current Portable Library project


Steps to reproduce VS2015 community edition, then make a solution with two projects, both are "C# Classlibrary (Portable)

Both projects have these two targets:

  • .NET Framework 4.6
  • ASP.NET Core 1.0

My problem is that when I try to do solution references from one project to the other then I get the error:

The targets of Portable Library project are not the same or compatible with the targets of the current Portable Library project

I assume it must be something obvious.


Solution

  • This is a workaround, but at least it works for me to run against the standard library instead.

    {
      "supports": {},
      "dependencies": {
        "NETStandard.Library": "1.6.0",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
        "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
        "Microsoft.Extensions.Configuration.Json": "1.1.0"
      },
      "frameworks": {
        "netstandard1.4": {}
      }
    }