Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Dec 17, 2025

We add an analyzer that will flag the previous usage as an error (requiring the removal of the T or setting it to the actual service to register). This should prevent bumps and rebuilds without notice.

Since the attributes don't have run-time impact but are rather purely compile-time, bumping but not building (i.e. via a transitive dependency, say or direct copying), would not cause runtime failures because the registrations in the previously compile assembly would remain as they were.

This unlocks a very useful scenario to trim down the amount of registered interfaces.

Fixes #281

We add an analyzer that will flag the previous usage as an error (requiring the removal of the T or setting it to the actual service to register). This should prevent bumps and rebuilds without notice.

Since the attributes don't have run-time impact but are rather purely compile-time, bumping but not building (i.e. via a transitive dependency, say or direct copying), would not cause runtime failures because the registrations in the previously compile assembly would remain as they were.

This unlocks a very useful scenario to trim down the amount of registered interfaces.

Fixes #281
@kzu kzu added the enhancement New feature or request label Dec 17, 2025
@kzu kzu enabled auto-merge (rebase) December 17, 2025 23:41
@kzu
Copy link
Member Author

kzu commented Dec 17, 2025

39 passed 39 passed

🧪 Details on Ubuntu 24.04.3 LTS

from dotnet-retest v1.0.0 on .NET 10.0.1 with 💜 by @devlooped

@kzu kzu merged commit 1dd3bb4 into main Dec 17, 2025
7 checks passed
@kzu kzu deleted the dev/tservice branch December 17, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ServiceAttribute<TService> to allow specifying a service type

2 participants