Description
Microsoft.Extensions.DependencyInjection.AutoActivation is not working.
Reproduction Steps
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddActivatedSingleton<MyService>();
Console.WriteLine("Build Before");
ServiceProvider provider = services.BuildServiceProvider();
Console.WriteLine("Build After");
provider.GetRequiredService<MyService>();
Console.WriteLine("End");
class MyService
{
public MyService() => Console.WriteLine("MyService Created");
}
Expected behavior
The expected output should be, in order:
"Build Before"
"MyService Created"
"Build After"
"End"
Actual behavior
The actual output is:
"Build Before"
"Build After"
"MyService Created"
"End"
Regression?
No response
Known Workarounds
No response
Configuration
Microsoft.Extensions.DependencyInjection: 10.0.7
Microsoft.Extensions.DependencyInjection.AutoActivation: 10.5.0
.NET SDK:
Version: 10.0.203
Commit: c23858a6d8
Workload version: 10.0.200-manifests.f8ca1cb9
MSBuild version: 18.3.3+c23858a6d
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.203\
Other information
No response
Description
Microsoft.Extensions.DependencyInjection.AutoActivationis not working.Reproduction Steps
Expected behavior
The expected output should be, in order:
"Build Before""MyService Created""Build After""End"Actual behavior
The actual output is:
"Build Before""Build After""MyService Created""End"Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response