Questions tagged [dryioc]

DryIoc is small, fast, capable IoC Container for .NET

DryIoc provides modern take on IoC/DI automation with Simplicity of use, Performance, and Features in mind.

236 questions
9
votes
1 answer

How to resolve a dependency in IValueConverter in Xamarin.Forms using Prism/DryIoC

I have a Xamarin.Forms app that uses Prism and DryIoC as the container. I have a value converter where I need to make use of a service I have registered via IContainerRegistry. containerRegistry.RegisterSingleton(); How…
joncortez
  • 93
  • 1
  • 5
7
votes
1 answer

Covariant service resolution by IoC container

I'm using dependency injection pattern for my application without any IoC Container. Now I decided to use some IoC Container because my Composition Root consists of thousands lines of code, but I failed to make it work with my classes, which…
Andrey
  • 1,601
  • 2
  • 11
  • 12
7
votes
1 answer

DryIoC - Specifying some constructor parameters at resolve time

I'm facing a rather puzzling situation with DryIoC. OK, actually, this is the first time I use an IoC container, so I may just be misunderstanding everything: from dependency injection, to IoC containers, to DryIoC itself. Still, I've been a…
rdeago
  • 136
  • 2
  • 8
6
votes
2 answers

Creating a Singleton with Multiple Service Registrations Using DryIoc

The Problem I'm trying to register a singleton using DryIoc, but container is returning multiple instances of my singleton class. The singleton class is registered as the implementation type for multiple different service interfaces. When any of the…
Brandon Baker
  • 1,232
  • 12
  • 16
6
votes
1 answer

How to resolve using parent hierarchy interfaces using DryIOC

I have the following objects structure public interface IParser {} public interface IAction : IParser {} public interface ICommand : IParser {} //impl public class Action1 : IAction {} public class Command1 : ICommand…
5
votes
1 answer

Use HostBuilder.ConfigureServices with DryIoc container?

I have some class libraries that provide services to the applications I create and for legacy reasons they are tightly bound to DryIoc. That is, the service registrations are tightly bound, not the actual services. If I can I would rather not just…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
5
votes
1 answer

Register ILoggerFactory in DryIoc container

I want to use Microsoft.Extensions.Logging with a DryIoc container. The default way is to register the factory as an instance, inject it and create a logger: ILoggerFactory loggerFactory = new…
5
votes
2 answers

DryIOC Container configuration for property injection

I have search far and wide for a simple example of how to configure a DryIoc container to simply inject dependencies as properties the same way that it injects constructor args. Given the following working example... Container registration: …
Colby
  • 85
  • 1
  • 2
  • 7
5
votes
2 answers

Where to put the Container?

I'm experimenting with IoC in my Web App and would like to do things according to best practices. Recently I discovered an IoC framework called DryIoc which is supposed to be small and fast. I've read through the examples but none seem to point out…
silkfire
  • 24,585
  • 15
  • 82
  • 105
5
votes
2 answers

Resolve one of multiple registrations with DryIoc

Given the small example below, is there a way to mark (attribute, name convention,... ) the MyInterface argument in MyService2, so that it will resolve correctly, or is the only way to pass in MyInterface[] ? I know that Castle Windsor can resolve…
smolesen
  • 1,153
  • 3
  • 11
  • 29
4
votes
2 answers

"The target platform must be set to Windows" when using Prism.DryIoc in .NET 6.0 Class Library

I am using a class library for tests and I need to configure DryIoc, so I reference the Nuget package Prism.DryIoc. Note that I am working on a Xamarin solution and do not have (or need) any WPF (or other Windows) components. When my class library…
Vladimir
  • 1,425
  • 16
  • 31
4
votes
0 answers

Can't get Prism 8 with DryIoc RegisterServices and Platform-Specific support to work

Trying to use Prism 8, ContainerLocator, IHttpClientFactory and Platform-Specific Service registration with DryIoc Extensions (not Magician) in a Xamarin Forms application I have these nuget packages installed Prism.DryIoc.Extensions Prism.Forms My…
Dave R
  • 1,626
  • 19
  • 28
4
votes
1 answer

DryIoc recursive dependency exception with Factory (Func<>)

Hey I've switched over to DryIoc from Autofac. My code previously worked but now causes an exception "Recursive dependency is detected when resolving". (Code is simplified) public class AFactory { public AFactory(Func getA){ } } public class…
user8051386
  • 115
  • 6
4
votes
1 answer

Resolve as null instead of an exception

In one of our projects we have the following scenario: We have a factory that creates a service of another package using it's factory (our factory configures the underlying factory, basically). The underlying factory uses a fluent syntax, and a…
EluciusFTW
  • 2,565
  • 6
  • 42
  • 59
4
votes
1 answer

Open generic singleton service registration that satisfies multiple interfaces

I am looking into how an event aggregator can be implemented directly in the DI container and struggling how to do that with DryIoC. I have the following example services and contracts for the event aggregation: public class EventHub :…
Georg
  • 5,626
  • 1
  • 23
  • 44
1
2 3
15 16