Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.31k stars 533 forks source link

RichTextEditor unable to resolve service for Blazorise.JVersionProvider #3465

Closed ClassyCircuit closed 2 years ago

ClassyCircuit commented 2 years ago

I followed the installation steps for RichTextEditor on your website, but after launching the application I get an exception:

System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: 
Blazorise.RichTextEdit.JSRichTextEditModule Lifetime: Scoped ImplementationType: Blazorise.RichTextEdit.JSRichTextEditModule': 
Unable to resolve service for type 'Blazorise.IVersionProvider' while attempting to activate 'Blazorise.RichTextEdit.JSRichTextEditModule'.)'

InvalidOperationException: Unable to resolve service for type 'Blazorise.IVersionProvider' 
while attempting to activate 'Blazorise.RichTextEdit.JSRichTextEditModule'.

This is my startup.cs:

services.AddBlazoriseRichTextEdit(options => 
{
    options.UseShowTheme = true;
});
stsrki commented 2 years ago

Seems like you're missing a call to AddBlazorise, https://blazorise.com/docs/usage/bootstrap5

eg.

services
      .AddBlazorise( options =>
      {
          options.ChangeTextOnKeyPress = true;
      } )
ClassyCircuit commented 2 years ago

Yes, that was the issue. Thank you