- ABP Framework version: v7.1.1
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
[11:33:59 WRN] Unhandled exception rendering component: Value cannot be null. (Parameter 'stringLocalizer')
System.ArgumentNullException: Value cannot be null. (Parameter 'stringLocalizer')
at Microsoft.Extensions.Localization.StringLocalizerExtensions.GetString(IStringLocalizer stringLocalizer, String name)
at Volo.Abp.FeatureManagement.Blazor.Components.FeatureManagementModal.<>c__DisplayClass43_5.<BuildRenderTree>b__21(RenderTreeBuilder __builder9)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Blazorise.SelectItem`1.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
[11:33:59 ERR] Unhandled exception in circuit 'qZ_yD2E2sEZ7bY4bLqK6QptNM2WMr0hCZRrjd-heQQk'.
- Steps to reproduce the issue:"
- Create an application by ABP Suite.
- Start debug Blazor.Server.Host
- Login successfully.
- Click administration
- Click Settings
- Click Feature Management
- Click Manage Host features
- It works well.
- Change the database connection strong to my current running database which created by 2 year ago and working well after I upgrade to ABP 7.1.1
- Star debug Blazor.Server.Host.... Click Manage Host features. Then I will get failed with above exception.
8 Answer(s)
-
0
Hi,
Change the database connection strong to my current running database which created by 2 year ago and working well after I upgrade to ABP 7.1.1
I think the main problem may be caused by the database, can you share the DB file to reproduce the problem? shiwei.liang@volosoft.com
-
0
I have checked the source code of ABP Framework. Volo.Abp.FeatureManagement Volo.Abp.FeatureManagement.Blazor /Components/FeatureManagementModal.razor line 65.
I past the code as below
<SelectItem Value="@item.Value"> @CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </SelectItem>
Sometimes, CreateStringLocalizer(item.DisplayText.ResourceName) return a null object. So, GetString will throw exception.
You may think these senarios: Such as I change the file name /class name of Resource file. But a feature setting has already been stored into database many months ago...
-
0
-
0
I place the code in ConfigureServices and PreConfigureServices.
Configure<AbpLocalizationOptions>(options => { options.DefaultResourceType = typeof(BlazorOneResource); });
But I still get the same error as before.
-
0
At first, I placed the code in PreConfigureServices. Failed as before. Then, I placed the code in ConfigureServices, Failed again.
-
0
Hi,
Ok, maybe something wrong.
Can you provide the full steps that I can reproduce the problem? thanks.
PS: I don't have a database from two years ago
-
0
Good question, I will prepare a new ABP solution for you. After I create it by ABP Suite.
-
0
ok. thanks.