You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not able to run the basic implementation, the next exception appears:
Enyim.Caching.SerializationException: 'Exception 'Type '<>f__AnonymousType0`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' in Assembly 'MemCached2App1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.' while serializing '{ hello = world }'. See inner exception for details.'
This exception was originally thrown at this call stack:
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(System.Type) in FormatterServices.cs
System.Runtime.Serialization.FormatterServices.GetSerializableMembers.AnonymousMethod__5_0(System.Runtime.Serialization.MemberHolder) in FormatterServices.cs
System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey, System.Func<TKey, TValue>) in ConcurrentDictionary.cs
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(System.Type, System.Runtime.Serialization.StreamingContext) in FormatterServices.cs
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() in BinaryObjectInfo.cs
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(object, System.Runtime.Serialization.ISurrogateSelector, System.Runtime.Serialization.StreamingContext, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit, System.Runtime.Serialization.IFormatterConverter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter, System.Runtime.Serialization.SerializationBinder) in BinaryObjectInfo.cs
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(object, System.Runtime.Serialization.Formatters.Binary.BinaryFormatterWriter, bool) in BinaryObjectWriter.cs
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, object, bool) in BinaryFormatter.cs
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, object) in BinaryFormatter.cs
Enyim.Caching.Memcached.BinaryItemFormatter.DoSerialize(Enyim.Caching.SequenceBuilder, object)
...
[Call Stack Truncated]
Using the .Net Core 3.0, VS 2019
The text was updated successfully, but these errors were encountered:
Hello, I got the same error when trying to setup the library on ASP.Net Core project of Web API type, including the library in a Controller.
In Startup.cs I added:
public void ConfigureServices(IServiceCollection services)
{
services.AddMemcached("localhost");
services.AddControllers();
}
In the Controller I added:
[HttpGet]
public async Task<IActionResult> GetAsync()
{
var client = _memcachedCluster.GetClient();
await client.SetAsync("hello", new { hello = "world" });
return Ok(new { hello = "world" });
}
I'm not able to run the basic implementation, the next exception appears:
Enyim.Caching.SerializationException: 'Exception 'Type '<>f__AnonymousType0`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' in Assembly 'MemCached2App1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.' while serializing '{ hello = world }'. See inner exception for details.'
This exception was originally thrown at this call stack:
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(System.Type) in FormatterServices.cs
System.Runtime.Serialization.FormatterServices.GetSerializableMembers.AnonymousMethod__5_0(System.Runtime.Serialization.MemberHolder) in FormatterServices.cs
System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey, System.Func<TKey, TValue>) in ConcurrentDictionary.cs
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(System.Type, System.Runtime.Serialization.StreamingContext) in FormatterServices.cs
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() in BinaryObjectInfo.cs
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(object, System.Runtime.Serialization.ISurrogateSelector, System.Runtime.Serialization.StreamingContext, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit, System.Runtime.Serialization.IFormatterConverter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter, System.Runtime.Serialization.SerializationBinder) in BinaryObjectInfo.cs
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(object, System.Runtime.Serialization.Formatters.Binary.BinaryFormatterWriter, bool) in BinaryObjectWriter.cs
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, object, bool) in BinaryFormatter.cs
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, object) in BinaryFormatter.cs
Enyim.Caching.Memcached.BinaryItemFormatter.DoSerialize(Enyim.Caching.SequenceBuilder, object)
...
[Call Stack Truncated]
Using the .Net Core 3.0, VS 2019
The text was updated successfully, but these errors were encountered: