在使用 CachingFramework.Redis 时,我试图将对象插入到键、字段哈希中......
enter code here
var map = new MyMapping
{
DataSourceId = source.DataSourceId,
ExternalId = source.ExternalId,
StoreId = source.StoreId ?? 0,
LastConnection = source.LastConnection,
ApiKey = source.ApiKey
};
Context.Cache.SetHashed("MyRedisKey", "MyFieldKey", map, TimeSpan.FromHours(1));
但是,当我尝试恢复散列值时......
var MyCachedValue = Context.Cache.GetHashed<MyMapping>(("MyRedisKey", "MyFieldKey");
我得到错误...
“Microsoft.Azure.WebJobs.Host.FunctionInvocationException:执行函数时出现异常:MyFunction ---> System.Runtime.Serialization.SerializationException:找不到程序集'MySolution.MyProject.MyService,版本=1.0.0.0,文化=中性, PublicKeyToken=null'。\r\n 在异步 Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.FunctionInvocationFilterInvoker.InvokeAsync(Object instance,Object[] arguments)\r\n 在异步 Microsoft.Azure.WebJobs.Host.Executors .FunctionExecutor.InvokeAsync(IFunctionInvoker 调用者,ParameterHelper parameterHelper,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInstance 实例)\r\n ....