ctstone / csredis

.NET client for Redis and Redis Sentinel (2.8). Includes both synchronous and asynchronous clients.
Other
292 stars 111 forks source link

Adding support for .NET Core #36

Open aclemmensen opened 7 years ago

aclemmensen commented 7 years ago

This branch attempts at a conversion of the library to .NET Core with project.json/xproj files. I'm motivated to do this because another library I use (Disque.Net) uses this library, and converting this to .NET Core is a blocker in getting Disque.Net over.

The primary issues I've had in the conversion was the dependency on System.Runtime.Serialization, but as it turned out the only real dependency in that namespace was FormatterConverter, and all it contains is a bunch of calls to System.Convert which, thankfully, is available on Core.

I updated the test project to be a Core project as well, and all the tests are passing.

The only contract level change I had to make that may affect consumers is that IRedisSocket now returns a Task<Stream> instead of a Stream in the GetStream method. This is to accommodate SslStream which now only exposes an async method for authenticating.

The other potentially troublesome change I made is that the relationship between OnConnected and OnAsyncConnected on RedisConnector has been inverted to account for the change described above.

I also had to disable strong-name signing of the assemblies to get the tests to run locally.

tonyqus commented 4 years ago

nice work