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

captcha not found #6

Open
Itsamirmasoud opened this issue Nov 25, 2019 · 2 comments
Open

captcha not found #6

Itsamirmasoud opened this issue Nov 25, 2019 · 2 comments

Comments

@Itsamirmasoud
Copy link

hi
i'm using your angular package on my project.
my backend project is a web api core on .net core 2.2.
when i debug the project localy everything work fine, but when i deploy to iis(8.5,10) i get this error :

Untitled

here is my api configuration in startup.cs :

app.MapWhen(context => { Console.WriteLine(context.Request.Path); return context.Request.Path.ToString().EndsWith(".ashx"); }, appBuilder => { appBuilder.UseSimpleCaptcha(Configuration.GetSection("BotDetect")); } );

i went over your documentation a few times but found nothing related to this problem in .net core.

@botdetect-support
Copy link
Contributor

Please check the following page again:
https://captcha.com/angular-captcha.html#angular-aspnetcore-webapi-mvccore-backend-step2

Do you have the following line:
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
in the ConfigureServices(IServiceCollection services) function of your app's Startup.cs file?

@Itsamirmasoud
Copy link
Author

Itsamirmasoud commented Nov 26, 2019

Please check the following page again:
https://captcha.com/angular-captcha.html#angular-aspnetcore-webapi-mvccore-backend-step2

Do you have the following line:
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
in the ConfigureServices(IServiceCollection services) function of your app's Startup.cs file?

thank you for your help
i checked that page again....and i have done all that is said exactly as it is said.
i do have that line of code in my ConfigureServices method.
the only difference is that ConfigureServices is defined before Configure method not after it like your example.
any other suggestion?

i have this line of code right after the code that is in my first post :
app.UseMvcWithDefaultRoute();
does this have anything to do with my problem?

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

2 participants