Open MichaCo opened 6 years ago
any news on this? or more poignantly, any where to get the nuget package(s)? :)
@bbqchickenrobot you can get the beta packages from the myget feed and give it a try until I release it. I have to do more testing and maybe waiting for 2.1... In case you want to use System.Runtime.Caching on .NET Core, be aware that this is not released by MS yet (I'm using 4.5.0-preview1 atm)...
So if it looks like system.type will not have binary serialization support, does that mean we will just have to use .WithJsonSerializer()
if we are targeting .netstandard2.0?
@maldworth You can use any other serializer wich supports .NET Core
Main changes to target netstandard 2.0 are done I decided to drop most old targets in the process. E.g. .NET 4.0 will not be available anymore and .netstandard1.x not either. Most of the packages now require .NET461 | netstandard2.0 This allows a lot simplifications in code. I was able to remove almost all ifdefs, which makes testing a lot easier...
I'm not really happy of how some DI things work right now with the DI extension package, so I might actually rework that quite a bit. The idea would be to integrated the Microsoft.Extensions.Di into the CacheManager.Core package. That would become a primary dependency everywhere though. I then would replace my custom initialization via reflection with actually using the DI. I might implement named CacheManager instances/configuartion, too. The existing exposed functionality of CacheFactory should still work though by hiding the DI container...
Very happy to see this effort! :)
I decided to re-release 1.1.2 with just the Redis upgarde and some .NET Standard 2.0 support additions. That's version 1.2.0 which has just been released!
There are no new features or ported functionality to .NETStandard 2.0 in that CacheManager 1.2.0 release. It is exactly the same code as 1.1.2 but with those 2 additions.
Hope that helps!
Need help with anything?
Hello, any news on when the 2.x version will be released ? Thank you.
Any updates?
Hi, We really like CacheManager and would like to continue using it in the future. We are in the process of migrating to .net core and this is something that we obviously need to take into consideration. Understood its an open source project and nobody owes anyone anything. We would still kindly ask any update of whether it is still on your personal roadmap?
Thanks!
@amirxnz you can totally use the current release with .NET Core and ASP.NET Core, I'm using it for the past 2 years in production.
CM Version 1.2.0 targets .netstandard 2.0, which means you can use it with everything .NET Core and there shouldn't really be any issues... Otherwise, let me know.
Hi, Thank you for the answer.
We are having some trouble with the CacheManager.SystemRuntimeCaching? It looks like 1.2 is only for framework 4.5? (https://www.nuget.org/packages/CacheManager.SystemRuntimeCaching)
It is our understanding that this package is needed if we want to keep the results locally in addition to having a redis backplane? Is this correct?
Thanks
System.Runtime.Caching
has been back ported to .NET Core with some minor breaking changes.
The CacheManager package for that one is not released yet, that's correct.
As an alternative, you can use CM with Microsoft.Extensions.Caching instead or just the simple dictionary cache from the CacheManager.Core package. Both work cross plat.
Is my understanding correct that iff we use the simple "WithDictionaryHandle()" that means that we need to make sure there are no concurrency issues? However "CM with Microsoft.Extensions.Caching" is already thread-safe since it uses a concurrent dictionary? Are there any downsides to using Microsoft.Extensions.Caching?
Thanks again for all your support, we really appreciate it
Hey @amirxnz, no, the simple CM Dictionary handle also uses a ConcurrentDictionary internally and is supposed to be thread-safe. The main difference to Microsoft.Extensions.Caching is that CM Dictionary is faster because it doesn't implement a complicated CacheItem policy thing. And CM Dictionary checks for expired items more frequently. Microsoft.Extensions.Caching does run a check every 2 minutes or so, CM Dictionary does it every 10sec I think.
So, just choose the one you think works best for you.
Ok Thanks! I think we'll start with CM Dictionary and see how that treats us.
ask for help
https://github.com/MichaCo/CacheManager/issues/323
I have two projects operating a redis. One is the . Net framework and the other is the . Net CORE
This causes the. Net framework project to write to a cache . . Net core project that cannot be serialized
But. Net core does not have withbinaryserializer. How can I replace it ?
`
/// <summary>
/// Configures a <see cref="BinaryCacheSerializer"/> to be used for serialization and deserialization.
/// </summary>
/// <returns>The builder part.</returns>
public ConfigurationBuilderCachePart WithBinarySerializer()
{
Configuration.SerializerType = typeof(BinaryCacheSerializer);
return this;
}
/// <summary>
/// Configures a <see cref="BinaryCacheSerializer"/> to be used for serialization and deserialization.
/// </summary>
/// <param name="serializationFormatter">The <see cref="BinaryFormatter"/> for serialization.</param>
/// <param name="deserializationFormatter">The <see cref="BinaryFormatter"/> for deserialization.</param>
/// <returns>The builder part.</returns>
public ConfigurationBuilderCachePart WithBinarySerializer(BinaryFormatter serializationFormatter, BinaryFormatter deserializationFormatter)
{
Configuration.SerializerType = typeof(BinaryCacheSerializer);
Configuration.SerializerTypeArguments = new object[] { serializationFormatter, deserializationFormatter };
return this;
}
`
:update: Version 1.2.0 of CacheManager was released with the 1.x branch targeting .NetStandard 2.0, including the change to the new redis client version.
Breaking Change
I will drop any lower netstandard target in packages which had .netstandard1.x. Also, .NET4.0 support will be removed. Because this is a bigger change, this will be a major version release (2.0), together with upgrading Stackexchange.Redis to 2.x, see #251.
Changes
System.Type
will not be supported... => no support for Binary Serializer in netstandard2.0System.Configuration.ConfigurationManager
(package is currently in preview and breaks other projects because of mismatching deps)