Skip to content

Commit

Permalink
Package upgrades to support .NET Standard 2 and the new 2.x Stackexch…
Browse files Browse the repository at this point in the history
…ange.Redis client
  • Loading branch information
MichaCo committed Dec 6, 2018
1 parent b55f652 commit 8a6c054
Show file tree
Hide file tree
Showing 26 changed files with 80 additions and 120 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ Linux, Mono | -

## CacheManager Nuget Packages

> **Important:** The 1.2.x version of CacheManager does only upgrade the .NET Standard support and uses the latest StackExchange.Redis package which comes with some breaking changes (dropped .Signed package).
| Package Name | .Net 4.0 | .Net 4.5 | .NET Standard
|--------------| :-------: | :-------: | :-------:
| [CacheManager.Core][Core.nuget] | x | x | 1.2
| [CacheManager.StackExchange.Redis][Redis.nuget] | - | x | 1.5
| [CacheManager.Core][Core.nuget] | x | x | 1.2, 2.0
| [CacheManager.StackExchange.Redis][Redis.nuget] | - | 4.6.1 | 2.0
| [CacheManager.SystemRuntimeCaching][SystemRuntimeCaching.nuget] | x | x | -
| [CacheManager.Microsoft.Extensions.Caching.Memory][MSCache.nuget] | - | x | 1.3
| [CacheManager.Microsoft.Extensions.Configuration][Configuration.nuget] | - | x | 1.2
Expand Down
24 changes: 3 additions & 21 deletions samples/AspnetCore.WebApp/AspnetCore.WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>AspnetCore.WebApp</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>AspnetCore.WebApp</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,24 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Swashbuckle" Version="6.0.0-beta902" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
</ItemGroup>

</Project>
</Project>
18 changes: 6 additions & 12 deletions samples/CacheManager.Examples/CacheManager.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>CacheManager.Examples Console Application</Description>
<Authors>MICHA</Authors>
<TargetFramework>net451</TargetFramework>
<TargetFramework>net462</TargetFramework>
<AssemblyName>CacheManager.Examples</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>CacheManager.Examples</PackageId>
Expand All @@ -20,23 +20,17 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CacheManager.SystemRuntimeCaching\CacheManager.SystemRuntimeCaching.csproj" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<ProjectReference Include="..\..\src\CacheManager.Core\CacheManager.Core.csproj" />
<ProjectReference Include="..\..\src\CacheManager.Microsoft.Extensions.Configuration\CacheManager.Microsoft.Extensions.Configuration.csproj" />
<ProjectReference Include="..\..\src\CacheManager.Microsoft.Extensions.Logging\CacheManager.Microsoft.Extensions.Logging.csproj" />
<ProjectReference Include="..\..\src\CacheManager.Serialization.Json\CacheManager.Serialization.Json.csproj" />
<ProjectReference Include="..\..\src\CacheManager.StackExchange.Redis\CacheManager.StackExchange.Redis.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ProjectReference Include="..\..\src\CacheManager.SystemRuntimeCaching\CacheManager.SystemRuntimeCaching.csproj" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
<PackageReference Include="Unity" Version="4.0.1" />
<PackageReference Include="Unity" Version="5.8.11" />
</ItemGroup>

</Project>
</Project>
8 changes: 3 additions & 5 deletions samples/CacheManager.Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
using System.Threading;
using CacheManager.Core;
using Microsoft.Extensions.Logging;
#if NET451
using Microsoft.Practices.Unity;
#else
using Unity;
#endif
using Unity.Injection;
using Unity.Lifetime;

namespace CacheManager.Examples
{
Expand Down Expand Up @@ -361,4 +359,4 @@ public void PutSomethingIntoTheCache()
_cache.Put("myKey", "something");
}
}
}
}
7 changes: 4 additions & 3 deletions src/CacheManager.Core/CacheManager.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features. The Core library contains all base interfaces and tools. You should install at least one other CacheManager package to get cache handle implementations.</Description>
<TargetFrameworks>net40;net45;netstandard1.2</TargetFrameworks>
<TargetFrameworks>net40;net45;netstandard1.2;netstandard2</TargetFrameworks>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
Expand All @@ -15,6 +15,7 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions src/CacheManager.Couchbase/CacheManager.Couchbase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager extension package to work with Couchbase as a distributed cache. CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.</Description>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net452;netstandard1.5</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
Expand All @@ -11,9 +11,9 @@
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CouchbaseNetClient" Version="2.4.4" />
<PackageReference Include="CouchbaseNetClient" Version="2.5.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System.Configuration" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<PropertyGroup>
<Description>CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features. This package contains the specific cache handle for Microsoft.Extensions.Caching.Memory.</Description>
<Authors>MichaConrad;AuroraDysis</Authors>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net451;netstandard1.3;netstandard2</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.0.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager extension package to use Microsoft.Extensions.Configuration to configure the CacheManager instance. CacheManager is an open source caching abstraction layer for .NET written in C#. This is the ASP.NET Core configuration integration package.</Description>
<TargetFrameworks>net45;netstandard1.2</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.2;netstandard2</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.0.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager extension package to work with Microsoft.Extensions.Logging as logging provider. CacheManager is an open source caching abstraction layer for .NET written in C#. The ASP.NET Core logging provides a bridge to the Microsoft.Extensions.Logging framework.</Description>
<TargetFrameworks>net45;netstandard1.2</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.2;netstandard2</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager extension package providing JSON serialization for distributed caches. CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features. The Core library contains a Newtonsoft.Json based serializer implementation which can be used instead of the default binary serializer.</Description>
<TargetFrameworks>netstandard1.2;net40;net45</TargetFrameworks>
<TargetFrameworks>netstandard2;netstandard1.2;net40;net45</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.2' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2' ">
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>CacheManager extension package providing ProtoBuf serialization for distributed caches. CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features, the ProtoBuf serializer can be used in place of the default Binary Serializer</Description>
<Authors>Wenisman;MichaConrad</Authors>
<TargetFrameworks>netstandard1.3;net40;net45</TargetFrameworks>
<TargetFrameworks>netstandard2;netstandard1.3;net40;net45</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
Expand All @@ -12,10 +12,6 @@
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="protobuf-net" Version="2.1.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<PackageReference Include="protobuf-net" Version="2.4.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>CacheManager extension package which adds support for Redis as a distributed cache layer. CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.</Description>
<TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>net461;netstandard2</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching;Cache;CacheManager;Distributed Cache;StackExchange Redis;Azure AppFabric;Memcached</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StackExchange.Redis.StrongName" Version="1.2.6" />
<PackageReference Include="StackExchange.Redis" Version="2.0.513" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CacheManager.Core\CacheManager.Core.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System.Configuration" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected override void Dispose(bool managed)

private void Publish(byte[] message)
{
_connection.Subscriber.Publish(_channelName, message, CommandFlags.HighPriority);
_connection.Subscriber.Publish(_channelName, message, CommandFlags.None);
}

private void PublishMessage(BackplaneMessage message)
Expand Down Expand Up @@ -317,4 +317,4 @@ private void Subscribe()
CommandFlags.FireAndForget);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public IConnectionMultiplexer Connect()
}
}

connection.PreserveAsyncOrder = false;
_connections.Add(_connectionString, connection);
}
}
Expand Down Expand Up @@ -228,4 +227,4 @@ public override void Write(char[] buffer, int index, int count)
}
}
}
}
}
4 changes: 2 additions & 2 deletions test/CacheManager.Benchmarks/BaseCacheManagerBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static IMemcachedClientConfiguration MemcachedConfig
new BaseCacheManager<string>(BaseConfig.Builder
.WithMemcachedCacheHandle(new MemcachedClient(MemcachedConfig)).Build());

[Setup]
[GlobalSetup]
public void Setup()
{
DictionaryCache.Clear();
Expand Down Expand Up @@ -207,4 +207,4 @@ protected override void Excecute(ICacheManager<string> cache)
}

#endregion upate
}
}
6 changes: 2 additions & 4 deletions test/CacheManager.Benchmarks/CacheManager.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net462</TargetFramework>
<AssemblyName>CacheManager.Benchmarks</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>CacheManager.Benchmarks</PackageId>
Expand All @@ -19,12 +19,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.8" />
<PackageReference Include="System.Buffers" Version="4.3.0" />
<PackageReference Include="System.Buffers" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="1.1.0" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
</ItemGroup>
</Project>
Loading

0 comments on commit 8a6c054

Please sign in to comment.