Razor.SweetAlert2 icon indicating copy to clipboard operation
Razor.SweetAlert2 copied to clipboard

'IServiceCollection' does not contain a definition for 'AddSweetAlert2'

Open boruchsiper opened this issue 3 years ago • 5 comments

After Installing the nuget package, tried adding "services.AddSweetAlert2();" to Startup.cs. Getting this error message

Error CS1061 'IServiceCollection' does not contain a definition for 'AddSweetAlert2' and no accessible extension method 'AddSweetAlert2' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) Test C:....\Startup.cs 31 N/A

boruchsiper avatar Jan 07 '21 22:01 boruchsiper

Did you added using CurrieTechnologies.Razor.SweetAlert2; in the top of your source file?

arivera12 avatar May 31 '21 05:05 arivera12

1- i installed package. 2-add builder.services. and in index page add using CurrieTechnologies.Razor.SweetAlert2; 3- how can I use basically show message.

public void OnPostSave() { Swal.FireAsync("Hello world!"); } Swal does not exist in the current context. :(

davut5 avatar Jul 27 '22 08:07 davut5

@boruchsiper @arivera12

davut5 avatar Jul 27 '22 08:07 davut5

Add this at the top of the file:

using CurrieTechnologies.Razor.SweetAlert2;

arivera12 avatar Jul 27 '22 23:07 arivera12

That was it. Thanks.

boruchsiper avatar Jul 28 '22 17:07 boruchsiper