© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
5 replies
SpReeD

✅ Blazor / ASP.NET - @inject keyed service

Is there a way in .NET 8 to inject a keyed service like a normal service with the
@inject
@inject
keyword?
I know of the
FromKeyedServices
FromKeyedServices
attribute, but cannot figure out how to use it in combination with
@inject
@inject
.
I thought of a way like
@inject [FromKeyedServices("MyService")] ServiceClass FooBar;
@inject [FromKeyedServices("MyService")] ServiceClass FooBar;
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

ASP.NET Core Blazor + EF error
C#CC# / help
3y ago
ASP.NET: Elegant controller <-> service interaction
C#CC# / help
2y ago
✅ asp.net background service with database
C#CC# / help
3y ago
WCF Connected Service ASP NET Core
C#CC# / help
4y ago