I am running Visual Studio 2015 Update 3. I am trying to use Redis Cache for .Net core applications. Since, the developed package is targeting .Net Standard Library. I downloaded the code from github and trying to change the dependecies my self.
Here are the projects:
First, I am trying to chage the Abstractions Class Library to target .Net Core, then i tried to add the Microsoft.Extensions.Primitives, Since the version 1 does not support .NET Core. I added the final pre package:
Install-Package Microsoft.Extensions.Primitives -Version 1.0.0-rc1-final -Pre
It cannot resolve, saying that
The dependency Microsoft.Extensions.Primitives >= 1.0.0-rc1-final could not be resolved.
How Can I fix that to make it work for .NET Core? How is .NET Core 1 different from .NET Core 5, since these are dependencies of the package I installed?
Why all the packages support .NET Standard Libary and not .NET Core?
Dunno what exactly you're doing, but rc1 references seem wrong, now that ASP.NET Core RTM is out for several months.
I grabbed the 1.0.0 sourced (you have to specifically choose the 1.0.0 tag. Master branch is based on ASP.NET Core 1.1).
Only thing I changed is
project.json
(I unloaded the other unloaded unrelated projects and test projects exceptMicrosoft.Extensions.Caching.Redis.Test
.This is my
project.json
(ofMicrosoft.Extensions.Caching.Redis
):No changes required in
Microsoft.Extensions.Caching.Abstractions
.Alternatively you can use
StackExchange.Redis
instead ofStackExchange.Redis.StrongName
which isn't strong named (signed). Not sure if the so created/compiled package will be signed with the same key as the other packages, which may create issues later. If you use unsigned one then it also may create issues, if your application is strong named itself (or you have business requirement that all assemblies are strong signed).This compiles and the unit tests pass, didn't test further.
As for the rest of your question:
".NET Core 5" nuget target is
dnx50
which was used up until ASP.NET Core rc1. With rc2 ASP.NET Core switched to the dotnet-cli and DNX is unsupported now and won't receive any further updates. With rc2 thenetstandard
was introduced to simplify creation of class libraries which can target most of the platforms available (full .NET Framework, .NET Core, WinRT/WindowsPhone/Windows8/Windows10, mono, Xamarin, etc). You can learn more about the .NET Standard Library.