Cannot get simple enyim memcached or log4net test.

I'm really trying to get protobuf-net transcoder , but before I can do this, I need to set up enyim / memcached and the documentation available, I have problems. Here is my simple .net test:

using Enyim.Caching; using Enyim.Caching.Memcached; .... MemcachedClient Cache = new MemcachedClient(); string key = "somekey"; string objectToCache = "someval"; Cache.Store(StoreMode.Set, key, objectToCache, DateTime.Now.AddMinutes(1000000)); string test = Cache.Get(key) as string; //...it null though 

My memcached 1.4.14 (x64) server is here and seems to work fine as a windows service, and I use the latest nuget packages for enyim and protobuf, but (even with transcoding turned off, so pure enyim / memcached) is out of luck. Then, again using the EnyimMemcached EnyimMemcached-log4net nuget package to try to enable log4net through my web.config according to the instructions here , I get this error:

Could not load file or assembly 'log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821' or one of its dependencies. The installed assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ":" log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821

... which seems to return a null version of log4net (link to project 1.2.11), even if it handles the dependencies themselves. So I can’t even understand why enyim cannot save / receive.

What are the right steps to do this?

EDIT : commenting on any reference to duration, it works (including transcoding).

 Cache.Store(StoreMode.Set, key, objectToCache); //, DateTime.Now.AddMinutes(1000000)); 

So, to slightly modify the original question: is there something wrong with using expiresAt? And is there an easy way to get log4net to work in the current incarnation of enyim?

+4
source share
2 answers

The answer looks like a poor memcached build, see this question . I cannot confirm this because couchbase d / l 1.4.5 does not work as a proper Windows service (as my caching layer should).

Regarding the version of log4net / enyim, updating the nuget package manager when requested through the VS extension manager seems to have enabled it, although I never did it.

+1
source

I had the error "Could not load file or assembly log4net, Version = 1.2.10.0."

In my case, it worked out; 'EnyimMemcached-log4net' The NuGet package requires a 1.2.10.0 version of "log4net", although this was not specifically mentioned in the dependencies. Installing the required log4net package solved it for me.

 Install-Package log4net -version 1.2.10.0 
0
source

All Articles