I need to configure localization in Blazor WASM, .NET 6
According to the manual, I need to use JavaScript in the Program.cs
file. Microsoft recommends connecting JavaScript code through JavaScript isolation in JavaScript modules. However, the code specified in the example is the Blazor component, and IAsyncDisposable.DisposeAsync()
is called there
Do I need to call IAsyncDisposable.DisposeAsync()
in Program.cs
and if so, how to do it without resorting to creating the Program
class and the Main
method, but using a new version of the console program template?
The question is very stupid on my part. I didn't see the most obvious solution.
You can just call the DisposeAsync() method manually when the object is no longer needed.
As a result, the code will look like this. The code is slightly different from the template, so part of the logic is placed in a separate class.