Skip to content

Conversation

@maliming
Copy link
Member

@maliming maliming commented Nov 2, 2025

Related to #23343
Resolve #23755

The ASP.NET Core default dependency injection system doesn't allow consuming a scoped service from a singleton service.

This error only happened if we didn't call the UseAutofac(Use Autofac to replace default).

var builder = WebApplication.CreateBuilder(args);
builder.Host.UseAutofac();

Resolve #23755

NET doesn't allow consuming a scoped service from a singleton service.
@maliming maliming added this to the 9.3-patch-final milestone Nov 2, 2025
@maliming maliming requested a review from hikalkan November 2, 2025 10:11
@hikalkan
Copy link
Member

hikalkan commented Nov 6, 2025

This service doesn't need to be a singleton in any way since it doesn't store a state. Thanks.

@hikalkan hikalkan merged commit 3bfb630 into rel-9.3 Nov 6, 2025
3 checks passed
@hikalkan hikalkan deleted the TelemetryActivityEventBuilder branch November 6, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants