Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web Development
>
UI Framework
&&
Watch
Unwatch
Watching
Releases Only
Ignoring
489
Star
15.9K
Fork
772
GVP
LongbowEnterprise
/
BootstrapBlazor
Code
Issues
1
Pull Requests
0
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
使用IStringLocalizerFactory生成IStringLocalizer后调用出错
Done
#I5SRA1
tiansfather
Opened this issue
2022-09-23 15:01
 ### 报错信息 Value cannot be null. (Parameter 'name') 在 System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) 在 System.Reflection.Assembly.GetType(String name) 在 BootstrapBlazor.Components.CacheManager.<>c__DisplayClass21_0.<GetStringLocalizerFromService>b__0(ICacheEntry entry) 在 BootstrapBlazor.Components.CacheManager.<>c__DisplayClass13_0`1.<GetOrCreate>b__0(ICacheEntry entry) 在 Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreate[TItem](IMemoryCache cache, Object key, Func`2 factory) 在 BootstrapBlazor.Components.CacheManager.GetStringLocalizerFromService(Assembly assembly, String typeName) 在 BootstrapBlazor.Localization.Json.JsonStringLocalizer.<GetStringSafely>g__GetStringFromService|24_0(String name) 在 BootstrapBlazor.Localization.Json.JsonStringLocalizer.get_Item(String name) ### 组件版本 latest 大佬,我看了下源码,你在 JsonStringLocalizerFactory 重写了GetResourcePrefix(TypeInfo typeInfo)方法,并在其中设置了类中字段TypeName,如下:  而IStringLocalizerFactory 有两个Create方法,其中一个是Create(Type type),此方法中调用了上面的GetResourcePrefix(TypeInfo typeInfo)方法,另一个方法是Create(string baseName, string location),这个方法调用的是GetResourcePrefix(string baseResourceName, string baseNamespace)  而这个方法并没有在派生类JsonStringLocalizerFactory 中重写,所以导致了用Create(string baseName, string location)这个方法创建的JsonStringLocalizer中的TypeName是null,就报错了 复现工程地址如下:https://gitee.com/tiansfather/boot-strap-blazor-test.git
 ### 报错信息 Value cannot be null. (Parameter 'name') 在 System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) 在 System.Reflection.Assembly.GetType(String name) 在 BootstrapBlazor.Components.CacheManager.<>c__DisplayClass21_0.<GetStringLocalizerFromService>b__0(ICacheEntry entry) 在 BootstrapBlazor.Components.CacheManager.<>c__DisplayClass13_0`1.<GetOrCreate>b__0(ICacheEntry entry) 在 Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreate[TItem](IMemoryCache cache, Object key, Func`2 factory) 在 BootstrapBlazor.Components.CacheManager.GetStringLocalizerFromService(Assembly assembly, String typeName) 在 BootstrapBlazor.Localization.Json.JsonStringLocalizer.<GetStringSafely>g__GetStringFromService|24_0(String name) 在 BootstrapBlazor.Localization.Json.JsonStringLocalizer.get_Item(String name) ### 组件版本 latest 大佬,我看了下源码,你在 JsonStringLocalizerFactory 重写了GetResourcePrefix(TypeInfo typeInfo)方法,并在其中设置了类中字段TypeName,如下:  而IStringLocalizerFactory 有两个Create方法,其中一个是Create(Type type),此方法中调用了上面的GetResourcePrefix(TypeInfo typeInfo)方法,另一个方法是Create(string baseName, string location),这个方法调用的是GetResourcePrefix(string baseResourceName, string baseNamespace)  而这个方法并没有在派生类JsonStringLocalizerFactory 中重写,所以导致了用Create(string baseName, string location)这个方法创建的JsonStringLocalizer中的TypeName是null,就报错了 复现工程地址如下:https://gitee.com/tiansfather/boot-strap-blazor-test.git
Comments (
4
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Argo
Longbow
Assignee
Collaborator
+Assign
+Mention
Nine
zhangpeihang
Assignee
Collaborator
+Assign
+Mention
Labels
bug
Not set
Label settings
Milestones
V6.11.0
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(3)
C#
1
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
git@gitee.com:LongbowEnterprise/BootstrapBlazor.git
LongbowEnterprise
BootstrapBlazor
BootstrapBlazor
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register