@usingSyncfusion.Blazor
<CascadingAuthenticationState>
<RouterAppAssembly="@typeof(Program).Assembly">
<FoundContext="routeData">
<AuthorizeRouteViewRouteData="@routeData"DefaultLayout="@typeof(MainLayout)">
<Authorizing>Authorizing,pleasewait...Authorizing>
<NotAuthorized>
<RedirectToLogin/>
NotAuthorized>
AuthorizeRouteView>
Found>
<NotFound>
<AuthorizeView>
<Authorized>
<LayoutViewLayout="@typeof(MainLayout)">
Sorry,there'snothingatthisaddress.
LayoutView>
Authorized>
<NotAuthorized>
<RedirectToLogin/>
NotAuthorized>
AuthorizeView>
NotFound>
Router>
CascadingAuthenticationState>
<ToastContainer/>
@code{
[Inject]
protectedIJSRuntimeJsRuntime{get;set;}
[Inject]
protectedHttpClientHttp{get;set;}
protectedoverrideasyncTaskOnAfterRenderAsync(boolfirstRender)
{
varlocale=awaitHttp.GetFromJsonAsync<object>("cs.json");
this.JsRuntime.Sf().LoadLocaleData(locale).SetCulture(culture);
}
}
I am getting this error:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: The JSON value could not be converted to Syncfusion.Blazor.LocaleData. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
System.Text.Json.JsonException: The JSON value could not be converted to Syncfusion.Blazor.LocaleData. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue (System.Type propertyType) <0x5983038 + 0x00032> in :0
at System.Text.Json.JsonPropertyInfoNotNullable`4[TClass,TDeclaredProperty,TRuntimeProperty,TConverter].OnRead (System.Text.Json.ReadStack& state, System.Text.Json.Utf8JsonReader& reader) <0x5982d90 + 0x00016> in :0
at System.Text.Json.JsonPropertyInfo.Read (System.Text.Json.JsonTokenType tokenType, System.Text.Json.ReadStack& state, System.Text.Json.Utf8JsonReader& reader) <0x3e2bae0 + 0x000c8> in :0
at System.Text.Json.JsonSerializer.HandleValue (System.Text.Json.JsonTokenType tokenType, System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& state) <0x3e2b688 + 0x000a6> in :0
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& readStack) <0x3e2afb0 + 0x00340> in :0
at System.Text.Json.JsonSerializer.ReadCore (System.Type returnType, System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader) <0x4b19d88 + 0x0002e> in :0
at System.Text.Json.JsonSerializer.Deserialize (System.String json, System.Type returnType, System.Text.Json.JsonSerializerOptions options) <0x4b19718 + 0x0017a> in :0
at System.Text.Json.JsonSerializer.Deserialize[TValue] (System.String json, System.Text.Json.JsonSerializerOptions options) <0x5879368 + 0x0000c> in :0
at Syncfusion.Blazor.Locale.SetLocale (System.String localeContent, System.Boolean webAssembly) <0x409d0f0 + 0x0008e> in :0
at Syncfusion.Blazor.Base.LoadLocaleData (System.Object localeObject) <0x5867828 + 0x00024> in :0