首页 新闻 会员 周边 捐助

ABP.NET CORE2.0 开启Redis时报错

0
悬赏园豆:200 [已解决问题] 解决于 2018-04-08 15:24

未开启redis的时候是正常的,开启之后位置app.UseAbpRequestLocalization()报错,如下:

Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.Collections.Generic.Dictionary`2[System.String,Abp.Localization.ApplicationLanguage]

-------------------------------------------------------

at Abp.Runtime.Caching.CacheExtensions.<GetAsync>d__5`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Localization.ApplicationLanguageManager.<GetLanguageDictionary>d__15.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\Localization\ApplicationLanguageManager.cs:line 174
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Localization.ApplicationLanguageManager.<GetLanguagesAsync>d__8.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\Localization\ApplicationLanguageManager.cs:line 57
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
at Abp.Localization.ApplicationLanguageProvider.GetLanguages() in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\Localization\ApplicationLanguageProvider.cs:line 35
at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app, Action`1 optionsAction) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\AbpApplicationBuilderExtensions.cs:line 81

十年丶小白菜的主页 十年丶小白菜 | 初学一级 | 园豆:4
提问于:2018-04-08 10:55
< >
分享
最佳答案
1

详见 Abp.RedisCache InvalidCastException when accessing settings,如果是 .net framework 版 abp 写入 redis 的缓存,在 .net core 版的 abp 中读取时会出现这个错误

收获园豆:180
dudu | 高人七级 |园豆:29384 | 2018-04-08 11:05

多谢,确实是不兼容.net core,已解决。

十年丶小白菜 | 园豆:4 (初学一级) | 2018-04-08 15:23
其他回答(1)
0

兄弟,第一句错误已经很明显啊

收获园豆:20
MrNice | 园豆:3468 (老鸟四级) | 2018-04-08 10:57

未开启redis的时候是正常的

支持(0) 反对(0) 十年丶小白菜 | 园豆:4 (初学一级) | 2018-04-08 10:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册