captcha-com / angular-captcha

BotDetect CAPTCHA: Angular Captcha Module (TypeScript: Angular 2/4/5/6/7/8+).
https://captcha.com/angular-captcha.html
16 stars 10 forks source link

captcha not found #6

Open Itsamirmasoud opened 4 years ago

Itsamirmasoud commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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?