babaktaremi / GoogleCaptchaComponent

🤖 Implementation of google reCaptcha as a blazor component with support of reCaptcha-V2 and reCaptcha-V3 and server validation
MIT License
77 stars 13 forks source link

Installation issue #12

Closed devabady closed 9 months ago

devabady commented 9 months ago

After installing your component from NuGet, I noticed that when I try to add the service, there is no extension method available in the service, and the namespace name cannot be found

babaktaremi commented 9 months ago

Which version of NET and the package you are using? Can you provide the code snippet? There is an extension method on IServiceCollection that configures the necessary services behind the scene:


using GoogleCaptchaComponent;
using GoogleCaptchaComponent.Configuration;

builder.Services.AddGoogleCaptcha(configuration =>
        {
            configuration.V2SiteKey = v2SiteKey;
            configuration.V3SiteKey = v3SiteKey;
            configuration.DefaultVersion = CaptchaConfiguration.Version.V2;
            configuration.DefaultTheme = CaptchaConfiguration.Theme.Light;
        });
devabady commented 9 months ago

NET 6, after installing your package, I couldn't find the 'googlecaptcha' namespace. I followed your installation steps as instructed

babaktaremi commented 9 months ago

NET 6, after installing your package, I couldn't find the 'googlecaptcha' namespace. I followed your installation steps as instructed

version 2 of package (which is deperacated) supports NET6 version 3 supports NET7 version 4 supports NET8

please use versions accordingly

devabady commented 9 months ago

Absolutely, you've made a lot of changes in version 4. can you make version 4 work in .NET 6

babaktaremi commented 9 months ago

Version 4 only supports NET8 and above at the moment you can fork this repo and make your own customizations and NET target version (though I strongly suggest to update your blazor project to NET8 if you can. It's easy and straight forward)

devabady commented 9 months ago

Okay, thanks. However, you should specify the package version so that when a developer tries to install the package from NuGet, a message will appear indicating that the package is not compatible with .NET 6, and the package won't be installed

babaktaremi commented 9 months ago

Okay, thanks. However, you should specify the package version so that when a developer tries to install the package from NuGet, a message will appear indicating that the package is not compatible with .NET 6, and the package won't be installed

Thanks for your suggestion but Nuget already lists package dependencies