未开启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
详见 Abp.RedisCache InvalidCastException when accessing settings,如果是 .net framework 版 abp 写入 redis 的缓存,在 .net core 版的 abp 中读取时会出现这个错误
多谢,确实是不兼容.net core,已解决。
兄弟,第一句错误已经很明显啊
未开启redis的时候是正常的