julian
Error on activation
Class I'm trying to activate
Activation:
Error:
Error msg was too long to be posted here.
https://pastebin.com/x0NsubVB
1 replies
✅ Contracts.dll for Domain not being activated
Hi, I'm trying out to build a Domain project where I have a Contracts project, that will have the interfaces (and logics) used in the Webclient.
I'm getting this error:
System.InvalidOperationException: Unable to resolve service for type 'Workcruit.Domain.Contracts.Interfaces.ITestInterface' while attempting to activate 'BackendForFrontend.Controllers.AuthController'.
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
at lambda_method8(Closure, IServiceProvider, Object[])
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>cDisplayClass6_0.<CreateControllerFactory>gCreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>gLogged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>gLogged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>gAwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
My code in the Domain:
Code in the WebClient:
Getting the error written at the top of this thread.
41 replies
❔ ASP.NET Core Web API with Auth0
So, I’ve been working on a project for about 8 months now, and was thinking of changing the Authentication system from my own written to Auth0, but how would It work with ASP.NET Core Web API?
Is it possible to have a /api/login endpoint, that redirects to auth0’s login page, and returns a token If successfully logged in?
5 replies
✅ Scoped, Singleton and HostedService
Any .NET Masters here? xD
Issue:
I'm trying to create a new Background Service for automatic selling/buying crypto (It's a school project, so no real trading/money involved).
I'm having issues with the activation of the repo/services etc.
I'm adding the Repo to my Service, which has EF Core (Repo).
It has Scoped on the Repository classes.
When I try to add the Service as a Singleton and my background service as a HostedService, I just get an error that It can not activate.
I'm using ASP.NET Core Web API
Any work arounds?
I've tried posting in the DotNetEvolution, but didn't get any response.
96 replies