Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boruchsiper opened this issue Jan 7, 2021 · 5 comments
Open

Comments

@boruchsiper
Copy link

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

@arivera12
Copy link

arivera12 commented May 31, 2021

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

@davut5
Copy link

davut5 commented Jul 27, 2022

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
Copy link

davut5 commented Jul 27, 2022

@boruchsiper @arivera12

@arivera12
Copy link

Add this at the top of the file:

using CurrieTechnologies.Razor.SweetAlert2;

@boruchsiper
Copy link
Author

That was it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants