{"id":16683503,"url":"https://github.com/marcominerva/keyedservicesissue","last_synced_at":"2025-09-20T23:34:43.885Z","repository":{"id":238457284,"uuid":"796593344","full_name":"marcominerva/KeyedServicesIssue","owner":"marcominerva","description":"This repository shows a different behavior of FromKeyedServices attribute in Minimal APIs endpoint handler and inside a class library. The issue has been solved in .NET 8.0.11.","archived":false,"fork":false,"pushed_at":"2025-01-29T13:52:39.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T12:31:22.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcominerva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T08:51:36.000Z","updated_at":"2025-01-29T13:52:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d7420de-6577-4edc-bd8f-a88b7d05f715","html_url":"https://github.com/marcominerva/KeyedServicesIssue","commit_stats":null,"previous_names":["marcominerva/keyedservicesissue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcominerva/KeyedServicesIssue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FKeyedServicesIssue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FKeyedServicesIssue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FKeyedServicesIssue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FKeyedServicesIssue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcominerva","download_url":"https://codeload.github.com/marcominerva/KeyedServicesIssue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FKeyedServicesIssue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262030489,"owners_count":23247667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T14:25:00.034Z","updated_at":"2025-09-20T23:34:38.836Z","avatar_url":"https://github.com/marcominerva.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Issue with FromKeyedServices attribute\n\nIf we use the `FromKeyedServices` attribute in a class library and the keyed registration is missing, it falls back to the default dependency injection behavior and gets the last registered implementation. However, If we use `FromKeyedServices` directly in a Minimal API endpoint handler and the key does not exist, it throws an exception.\n\nThis repo contains some examples that showcase all the different scenarios. Every endpoint comes with a description of the particular behavior it refers to.\n\nThe issue has been solved in .NET 8.0.11.\n\n![image](https://github.com/marcominerva/KeyedServicesIssue/assets/3522534/452daf1e-ac28-4a8d-8fd9-1d688bbd4da5)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Fkeyedservicesissue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcominerva%2Fkeyedservicesissue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Fkeyedservicesissue/lists"}