LazZiya / XLocalizer

Localizer package for Asp.Net Core web applications, powered by online translation and auto resource creating.
https://docs.ziyad.info
129 stars 14 forks source link

InvalidOperationException: Cache entry must specify a value for Size when SizeLimit is set. #26

Open Daeamon opened 3 years ago

Daeamon commented 3 years ago

Application: asp.net core 5 web application Razor Page Crashed

<a class="materials-filter-item @allActive" asp-area="" asp-route-interioreffectid="@Model.interioreffectid" asp-page="/Interiors">
    <localize>All</localize>
    @if (!String.IsNullOrEmpty(allActive))
    {
        <svg data-src="/Content/images/arrow-right-down.svg" fill="transparent"></svg>
    }
</a>

Exception

Microsoft.Extensions.Caching.Memory.MemoryCache.SetEntry(CacheEntry entry)
Microsoft.Extensions.Caching.Memory.CacheEntry.Dispose()
Microsoft.Extensions.Caching.Memory.CacheExtensions.Set<TItem>(IMemoryCache cache, object key, TItem value, MemoryCacheEntryOptions options)
XLocalizer.Common.ExpressMemoryCache.Set<T>(string key, string value)
XLocalizer.XStringLocalizer<TResource>.GetLocalizedString(string name, object[] arguments)
XLocalizer.XStringLocalizer<TResource>.get_Item(string name, object[] arguments)
XLocalizer.XHtmlLocalizer.GetHtmlString(string name, object[] arguments)
XLocalizer.XHtmlLocalizer.get_Item(string name)
XLocalizer.TagHelpers.LocalizationTagHelperBase.GetLocalizedHtmlString(string str)
XLocalizer.TagHelpers.LocalizationTagHelperBase.ProcessAsync(TagHelperContext context, TagHelperOutput output)
XLocalizer.TagHelpers.LocalizeTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, int i, int count)
Pratta.Pages.Pages_Interiors+<>c__DisplayClass15_1+<<ExecuteAsync>b__2>d.MoveNext()
Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
Pratta.Pages.Pages_Interiors.ExecuteAsync() in Interiors.cshtml
+
                    <a class="materials-filter-item @allActive" asp-area="" asp-route-interioreffectid="@Model.interioreffectid" asp-page="/Interiors">
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
LazZiya commented 3 years ago

Hi @Daeamon

Sorry I’m not able to offer a solution now due to some health issues :( may be after two weeks I will be able to help.