Closed fingers10 closed 4 months ago
Hi @fingers10, thank you for letting me know that! I'll investigate this problem and resolve it later. I appreciate your patience.
Hi @fingers10,
You should change your code from
services.AddSingleton(serviceProvider => new SlugService(serviceProvider.GetRequiredService<NavigationManager>()));
to
services.AddScoped(serviceProvider => new SlugService(serviceProvider.GetRequiredService<NavigationManager>()));
because your Blazor app code is running in a Blazor Server app during the pre-rendering process.
Many thanks for your time and response. I'll check this and keep you posted.
This works. Many thanks for your time and support. Much appreciated.
This works. Many thanks for your time and support. Much appreciated.
Hi @jsakamoto ,
I recently noticed that the Publishing fails when I have
NavigationManager
injected inside aclass
which is not a component.For example,
Register this in
Program.cs
This setup works fine locally when running but fails during publish.
Here is the exception details:
GitHub Actions Build: https://github.com/ILoveDotNet/ilovedotnet/actions/runs/9917040406/job/27400021468
Please can you assist me on this?