When trying to use Humanizer
in a Blazor Razor Page
// _Imports.razor
@using Humanizer;
// Page.razor
@file.Size.Bytes.ToString()
I get this error:
Error CS0119 'ByteSizeExtensions.Bytes(byte)' is a method, which is not valid in the given context
Using Humanizer
without a Razor page, directly in standard c# code, works fine.
Why do I get this error? How to fix it?
Solution: It needs to be
instead of