From 08b53c610c88ba98c34c2d3001c8d8c8dea8b277 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Sat, 7 Nov 2026 08:48:27 +0000 Subject: [PATCH] Resolve DI bug found whilst testing with Screenplay Has no issue #. The problem here is that when using ProxyGenerator with Reqnroll's BoDi container, BoDi is unable to instantiate an instance because it has multiple public constructors which have the same count of parameters (and no constructors with more parameters). So, this switches to manually constructing it, to avoid that ambiguity. It's a singleton, so there's no harm in doing that. --- CSF.Extensions.WebDriver/ServiceCollectionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CSF.Extensions.WebDriver/ServiceCollectionExtensions.cs b/CSF.Extensions.WebDriver/ServiceCollectionExtensions.cs index c039bda..91b672e 100644 --- a/CSF.Extensions.WebDriver/ServiceCollectionExtensions.cs +++ b/CSF.Extensions.WebDriver/ServiceCollectionExtensions.cs @@ -150,7 +150,7 @@ static void AddWebDriverFactory(this IServiceCollection services, public static IServiceCollection AddWebDriverFactoryWithoutOptionsPattern(this IServiceCollection services) { services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(new ProxyGenerator()); services.AddTransient(); services.AddTransient(s =>