27,014 questions
0
votes
0
answers
16
views
DryIoc matching Func arguments to specific dependencies of resolved service
I have the following simplified example:
var container = new Container();
container.Register<D>();
container.Register<C>();
var c = container.Resolve<Func<int, int, C>>()(2, 4);...
0
votes
2
answers
33
views
Getting appsettings by Options Pattern thorugh Helper Class
I'm trying to create a helper class with within a c# console application. I am using options pattern in mind so I don't have to store any sensitive data in code. So far this is what I have for the ...
0
votes
1
answer
34
views
MassTransit, create scoped IPublishEndpoint with IServiceScopeFactory does not publish message
My aim is to publish an audit message on RabbitMQ so that another service can consume it. I am capturing the audit inside the DbContext class by overriding the SaveChangesAsync method. My first ...
-2
votes
0
answers
51
views
How Do Spring Boot Starters Compare to Maven Archetypes for Simplifying Project Setup? [closed]
I noticed that Spring Boot opinionated starters seem somewhat similar to the older Maven quickstart archetypes in Eclipse. While I understand they aren't the same, both appear to serve a similar ...
-1
votes
1
answer
43
views
Dependency injection in Guidewire projects [closed]
Lately I have been thinking about introducing some dependency injection into some projects and I am thinking: have any of you encountered any successful use of dependency injection framework/library ...
0
votes
0
answers
22
views
How to inject tronclient into controller?
I am trying to make transactions on tron network in my controller, I am using tronsharp library for .NET 8.0.
This is my controller's constructor:
public TronController(DataContext context, ...
0
votes
1
answer
35
views
HttpClientFactory does not receive configuration
I have this setup:
services.AddHttpClient<IMyManagerFactory, MyManagerFactory>(c =>
{
c.Timeout = TimeSpan.FromMinutes(5);
})
.AddTransientHttpErrorPolicy(builder => ...
1
vote
0
answers
22
views
Nest could not find ' ' element (this provider does not exist in the current context)
I have been getting issues with the injections of Nest.js when working with TestingModule. The app works fine when ran but not through the tests. The issue happens when trying to get any other ...
-1
votes
1
answer
37
views
What happens to the variables stored in the lifecycle state in FastAPI? [closed]
I have a FastAPI app with MongoDB connected via Motor. I open a MongoDB connection at the beginning of an app and close it at the end using lifespan:
from contextlib import asynccontextmanager
from ...
0
votes
1
answer
33
views
Injection fails when the action is triggered from a child component
Learning Angular 18, I am facing an unexpected behaviour: injection silently failing when an action is triggered by a child component, but ultimately it's defined in the parent component, where the ...
0
votes
0
answers
17
views
Decorators work on Linux/Unix but not on Windows
I'm facing an issue with NestJS decorators when running in a Windows environment.
I have the following decorator:
export const customCommands: Function[] = [];
export function CustomCommand(target: ...
0
votes
1
answer
14
views
How to setup service by injecting `ioredis` client instance using module provider factory in nestjs
nestjs 10.4.6, ioredis 5.4.1, @nestjs-modules/ioredis 2.0.2
I using nestjs framework and I need to inject ioredis client instance defined in RedisModule into a service (MyService), that is setted up ...
1
vote
1
answer
34
views
Angular DI for standalone components with importing module on parent component and child component (NullInjectorError: R3InjectorError)
Given the following structure:
a parent standalone component named AppComponent
a child standalone component called TableComponent, which should be a wrapper for a generic table
TableComponent ...
0
votes
0
answers
31
views
Use Prism.Unity as DI for ASP.NET Core
I am working on a shared code base between a client and an ASP.NET Core application.
My problem is that ASP.NET Core uses Microsoft.DI and the client uses Prism.Unity, which leads to a log of code ...
1
vote
0
answers
47
views
How to create a maven dependency and use it in Spring boot
I want to create a maven dependency Spring boot and use it in other project. But I have compile error...
[INFO] [1m--- [0;32mcompiler:3.13.0:compile[m [1m(default-compile)[m @ [36msso[0;1m ---[m
[INFO]...
0
votes
0
answers
9
views
In asp.net core how to register both saml and cookie authentication method and use either one as per user's attribute
I have added a new field "EnternalUser" in aspnetuser table. This field will have the value either 0 or 1. if it is set as 1 then I would like to use cookie authentication, otherwise I ...
0
votes
2
answers
44
views
How can I provide a default configuration for all Aspire Services?
I want to provide a set of configuration defaults for all my services. Those defaults should be managed by the AppHost or another shared Assembly.
So here are the relevant code snippets:
AppHost/...
1
vote
1
answer
55
views
NG0203: Inject() must be called from an injection context. Angular v19.0.1
As seen, receiving the common angular bug for injection contexts. Tried to get all the various angular component packages to be on v19.0.1 but some kind of mismatch is still persisting. Have tried ...
1
vote
1
answer
27
views
Dependency Injection Issue with Generic Repository and Specific Service in ASP.NET Core
I am working on an ASP.NET Core project where I am using a generic repository pattern alongside specific services. I have implemented the following interfaces and classes:
Shared Interfaces:
namespace ...
0
votes
1
answer
30
views
Defining and blanket implementing a common trait to avoid dependencies in Rust
High level problem statement
I have various generic containers defined in many different crates using a common declarative macro. Each looks something like:
struct Container1<T> {
a: T,
...
-3
votes
0
answers
32
views
Missing argument for parameter 'sessionClient' in call [duplicate]
I'm encountering a problem in my view file Missing argument for parameter 'sessionClient' in call Basically I'm using dependency which calls VideoQualityViewModel to retrieve subscription types and ...
0
votes
1
answer
67
views
How to implement scoped services in tabs, (preferably) in a WPF application using Prism? [closed]
I'm creating a WPF application using the Prism framework and have run into an issue with dependency injection scopes. My application contains multiple tabs (2, at least for now), each with identical ...
0
votes
1
answer
42
views
How does Koin manage memory for single, factory, and scoped objects?
I’m using Koin for dependency injection in my Kotlin app and need clarification on how memory is managed for different object definitions like single, factory, and scoped.
Memory Allocation Questions:
...
0
votes
0
answers
12
views
Get injected attribute directive from another directive
I've have two nested custom directives on third-party components. I can't find a way to inject or access the actual directive (with custom functions/logic) instead of the base component. Here is a ...
-2
votes
1
answer
67
views
error Extra arguments at positions #1, #2 in call [closed]
Hello I'm in a swiftUI project with the mvvm format I want to get the client sessions with a dependency but I have the following error Extra arguments at positions #1, #2 in call I have a view a ...
-1
votes
0
answers
70
views
Dependency life cycles are weird in Blazor WebAssembly Standalone app
I have setup an event broker which is shared between a DelegatingHandler and the AuthenticationStateProvider of the wasm app.
class LogoutBroker
{
// For debugging purpose.
public Guid Id = Guid....
0
votes
1
answer
36
views
How to inject LocationTracker using Koin DI framework
I'm migrating from Hilt to Koin.
With Hilt I'm doing the following for injecting LocationTracker:
@Module
@InstallIn(SingletonComponent::class)
object LocationModule {
@Provides
@Singleton
...
0
votes
1
answer
55
views
Can't inject Emitter into class using Quarkus: jakarta.enterprise.inject.spi.DefinitionException: SRMSG00019: Unable to connect an emitter
I have a class in which I run a check on a schedule using Quartz inside of an Quarkus application.
The result should be send with AMQP using an emitter.
Unfortunately the emitter can not be injected. ...
3
votes
1
answer
49
views
Issue with open generic interface while try to get instance using `IServiceProvider` with composition root
Using .NET Core DI container, registered open generic interface with DI container, but while trying to resolve it in 2 different ways to get its corresponding instance keep getting compile exception:
...
0
votes
1
answer
47
views
Logger dependency injection error (Cannot read properties of undefined)
When I give the logger as a dependency to the class I am getting the following error:
Screenshot of error message details
E:\my_site\src\common\database\MongoDBConnector.ts:11
constructor(@inject(...
0
votes
1
answer
47
views
Register open generic Serilog logger via factory
One can resolve a framework logger with category by idiomatic .NET code:
using Microsoft.Extensions.Logging;
public class Foo
{
private readonly ILogger<Foo> _logger;
public Foo(ILogger<...
0
votes
0
answers
28
views
Nestjs not injecting service to controller
I'm migrating a backend to serverless and want to keep my current nestjs setup for now, but I'm having an issue that prevents me to run usecases/services (they're the same I just call them differently ...
1
vote
1
answer
35
views
TYPO3 dependency injection only inject*() method, not constructor
I'm upgrading from TYPO3 v10 to v11.
In TYPO3 v10 this worked:
<?php
use TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement;
class ServiceSelectFormElement extends GenericFormElement
{
...
5
votes
1
answer
164
views
How to get constructor parameter types as a tuple in C++?
Unable to retrieve constructor arguments in a tuple.
I am trying to extract the constructor parameter types of a given class as a std::tuple. For example, if I have a class like this:
struct MyClass {
...
0
votes
2
answers
34
views
Inject ComponentActivity Class with DaggerHilt
I have an implementation class using an Activity Contract to select a ringtone:
class RingtonePickerImpl @Inject constructor( activity: ComponentActivity )
: RingtonePicker {
private ...
4
votes
2
answers
162
views
How to access provider value in Angular 19
Using Angular SSR, I would like to access a server-side value in my app.component.
Here is my server-side route:
app.get('**', (req, res, next) => {
const { protocol, originalUrl, baseUrl, ...
0
votes
0
answers
31
views
Hilt gives class cast exception when try to start an activity inside an android lib
I am developing an android sdk and using hilt inside my lib.
Inside my lib, there is an activity and inside my activity, I manage lib related fragments internally.
If I build my lib without proguard ...
0
votes
1
answer
46
views
.NET Core DI multiple interfaces
There are some services and their interfaces:
public class ServiceA: IServiceA
{}
public class ServiceB: IServiceB
{}
public class ServiceC: IServiceC
{}
All of them have the same method
public ...
0
votes
2
answers
37
views
Register service and implementation usng AddKeyedScoped
This is my interface
public interface IService
{
public Task<string> GetString();
}
THis is my DAL class
public class SampleDAL : IService
{
public async Task<string> GetString()
...
0
votes
1
answer
45
views
Supabase storage auth with FastAPI Depends
I've the following setup:
def get_user_token(request: Request, x_user_token: str = Header(None)):
return x_user_token
def get_storage(token: str = Depends(get_user_token)):
supabase.auth....
0
votes
0
answers
30
views
Providing Kotlin-Inject dependency with SavedStateHandle parameter
I need to use Kotlin-Inject dependency injection library, currently with Android, but in the future target is to have Multiplatform app (iOS + Android)
I have a FlowController interface:
interface ...
0
votes
0
answers
40
views
Dependency Injection into Community Toolkit Visual Studio Extension ToolWindow is not working
If I create a regular VSIX project(not a community one)
add a tool window,
and then add Autofac Dependency Injection infrastructure. This works fine as expected.
I basically picked up the idea from ...
0
votes
1
answer
47
views
How to handle disposal of objects when using DI/IoC container?
I am using DryIoc, but I think this is a general question applicable to any IoC container.
Consider a singleton service(Let's call it SingletonService). The SingletonService needs a new set of objects ...
0
votes
0
answers
33
views
ASP.NET Core Blazor -> Scoped AppState lifecycle of Blazor components
I am using ASP.NET Core to build a simple login with multiple Blazor components.
I want to store my AppState such as IsLoggedIn inside my AppState code and subscribe to the OnChange method for UI ...
-1
votes
0
answers
41
views
Use FastAPI dependency outside of function arguments [duplicate]
I would like to use a FastAPI dependency outside of a function's arguments.
Instead of:
@app.get("/")
def endpoint(a_dep: Annotated[str, Depends(a_dependency)]):
pass
I would like to do:...
0
votes
0
answers
18
views
Koin: NoBeanDefFoundException when navigating back from an activity
I have an android app, that when closed, if I click on a specific pop up message, I get navigated to the splash screen. From there I get navigated to the home screen, and conditionally (checking if I ...
2
votes
1
answer
74
views
.NET 8 console dependency injection pass data from JSON to class not working
I have the following code and if I run it with line 36 comment removed, I get the data from the .json file into the variable CollarSurveyPickupSettings.
If I then run the cspvm line at row 37 (...
0
votes
2
answers
46
views
Call method with autowired parameter
I want to call service method dynamically with autowired parameters
for now I do as followed :
$result = call_user_func_array([$myService,"myMethod"],[$entityManager,$tranlator]);
The ...
1
vote
1
answer
34
views
Can I define a provider scope without listing all providers in that scope in Angular?
I have some Angular services that store state, and I’d like these to be scoped to the appropriate component (and its subcomponents) to avoid leaking state between different instances of the same ...
-2
votes
0
answers
29
views
How to handle dependencies in FastAPI?
Here is the simplified file structure of my project:
.
├── app
│ ├── __init__.py # Initializes settings
│ ├── settings.py # Pydantic settings definitions
│ ├── dependencies.py #...