Skip to content

Version scoped verifier task name - #31

Merged
SimonCropp merged 4 commits into
mainfrom
version-scoped-verifier-task-name
Aug 7, 2026
Merged

Version scoped verifier task name#31
SimonCropp merged 4 commits into
mainfrom
version-scoped-verifier-task-name

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

No description provided.

MSBuild's task registry is keyed by task name alone — not assembly path,
identity, or version — and the first UsingTask to claim a name serves every
invocation of it in the project. Every SponsorCheck-bundling package ships its
own SponsorCheck.dll under the bare name VerifySponsorshipTask, so one copy ran
all the verifiers in a consumer project. Once two such packages bundled versions
with different task APIs, the build died with MSB4064, pointing at the newer
package's targets while naming the older package's DLL.

Unpinning AssemblyVersion did not fix this: registration is resolved before
assembly identity is consulted. That comment is corrected rather than dropped —
per-release AssemblyVersion still matters, and now also feeds the task name.

SponsorCheck.csproj now generates VerifySponsorshipTask_<version>, a subclass of
VerifySponsorshipTask (hence unsealed), plus a VersionedTaskName.Verify const
initialized with nameof so the bundler's substitution cannot drift from the type
compiled. Both verifier templates bind it through a new __SC_TASK_NAME__
placeholder. Version separators are sanitized to '_' so prerelease versions stay
valid identifiers. BundleSponsorListTask keeps its bare name — a project can only
reference one SponsorCheck version, so it cannot collide.

Packages published before this change still register the bare name, harmlessly,
since it no longer collides with anything newer.
@SimonCropp SimonCropp added this to the 0.19.0 milestone Aug 7, 2026
@SimonCropp
SimonCropp merged commit a15fb2c into main Aug 7, 2026
2 of 3 checks passed
@SimonCropp
SimonCropp deleted the version-scoped-verifier-task-name branch August 7, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant