This is my first experiment with the EF Core, ASP Net Core, and Portable Class libraries with VS2015. It’s fair to say that I'm upset.
I want to create a library where I can set EntityFramework.Core. This library must be used in the WPF application and in the ASP NET Core web application, while ignoring any good concepts of layered applications. My thought was to create a portable class library.
Using a project template where I am targeting .NET 4.6 and ASP Net Core ...

I get a project with class and project.json file as follows:
{ "supports": { "net46.app": {}, "dnxcore50.app": {} }, "dependencies": { "Microsoft.NETCore": "5.0.0", "Microsoft.NETCore.Portable.Compatibility": "1.0.0" }, "frameworks": { "dotnet": { "imports": "portable-net452" } } }
Now when I install the EntityFramework.Core package from nuget ...

... I get the following output:
Restoring packages for 'Acme.PCLEFClassLib'. Restoring packages for K:\TFS\TestApps\Projects\DotNetCore\Acme.PCL1\Acme.PCL1\project.json... Detected package downgrade: System.Reflection from 4.1.0-beta-23225 to 4.0.10 Acme.PCLEFClassLib (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final) -> System.Reflection (>= 4.1.0-beta-23225) Acme.PCLEFClassLib (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Reflection (>= 4.0.10) Detected package downgrade: System.Reflection from 4.1.0-beta-23225 to 4.0.10 Acme.PCLEFClassLib (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final) -> System.Reflection (>= 4.1.0-beta-23225) Acme.PCLEFClassLib (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Reflection (>= 4.0.10) Version conflict detected for System.Collections. Acme.PCLEFClassLib (>= 1.0.0) -> EntityFramework.Core (>= 7.0.0-rc1-final) -> System.Collections (>= 4.0.11-beta-23516) Acme.PCLEFClassLib (>= 1.0.0) -> Microsoft.NETCore.Portable.Compatibility (>= 1.0.0) -> Microsoft.NETCore.Runtime (>= 1.0.0) -> Microsoft.NETCore.Runtime.CoreCLR-x86 (>= 1.0.0) -> System.Collections (= 4.0.10). EntityFramework.Core 7.0.0-rc1-final is not compatible with .NETPlatform,Version=v5.0. Some packages are not compatible with .NETPlatform,Version=v5.0. Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0. Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0. Some packages are not compatible with DNXCore,Version=v5.0. Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0 (win7-x86). Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0 (win7-x86). Some packages are not compatible with DNXCore,Version=v5.0 (win7-x86). Ix-Async 1.2.5 is not compatible with DNXCore,Version=v5.0 (win7-x64). Remotion.Linq 2.0.1 is not compatible with DNXCore,Version=v5.0 (win7-x64). Some packages are not compatible with DNXCore,Version=v5.0 (win7-x64). Package restore failed for 'Acme.PCLEFClassLib'. Package restore failed. Rolling back package changes for 'Acme.PCLEFClassLib'. ========== Finished ==========
Is it possible to install EF Core in a portable class library? If so, how - what do I need to do with the project?
I just feel like I'm going to look around for solutions on the line.
UPDATE 1
Tried installing EntityFramework.MicrosoftSqlServer in my PCL.
Given that EntityFramework.MicrosoftSqlServer is installed when you create a standard ASP Net Core project that uses the dnxcore50 structure. Why, if I do this in the PCL, complains that:
EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final is not compatible with .NETPlatform,Version=v5.0.
If so, how is it installed in an ASP NET Core project.
UPDATE 2
I created new PCL targeting .NET 4.5.1. Then I installed EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final into it via Nuget and did not install any problems. Although I can’t repeat it now. I just created a standalone solution with a PCL library project focused on ASP NET Core and .NET 4.5.1. Now you get the following:
Attempting to gather dependency information for package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' with respect to project 'AnotherPCLEFFUP', targeting '.NETPortable,Version=v4.5,Profile=Profile75' Attempting to resolve dependencies for package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' with DependencyBehavior 'Lowest' Resolving actions to install package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' Resolved actions to install package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' Install failed. Rolling back... Package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' does not exist in project 'AnotherPCLEFFUP' Package 'EntityFramework.MicrosoftSqlServer.7.0.0-rc1-final' does not exist in folder 'K:\TFS\TestApps\Projects\DotNetCore\AnotherPCLEFFUP\packages' Invalid portable frameworks.
The same thing happens with the installation of EntityFramework.Core.7.0.0-rc1-final.
It is fair to say that it is completely frustrating. Maybe I'm barking the wrong tree or just barking crazy today.