Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Jan 9, 2026

Replace the ILLink custom step with an MSBuild task that runs before _RunILLink. This simplifies the build pipeline by removing a dependency on the ILLink step infrastructure while maintaining the same behavior.

The new CheckForObsoletePreserveAttribute task uses System.Reflection.Metadata for fast metadata scanning instead of Mono.Cecil.

Replace the ILLink custom step with an MSBuild task that runs before
_RunILLink. This simplifies the build pipeline by removing a dependency
on the ILLink step infrastructure while maintaining the same behavior.

The new CheckForObsoletePreserveAttribute task uses System.Reflection.Metadata
for fast metadata scanning instead of Mono.Cecil.
Comment on lines 103 to 105
<Target Name="_CheckForObsoletePreserveAttribute" BeforeTargets="_RunILLink">
<CheckForObsoletePreserveAttribute Assemblies="@(ManagedAssemblyToLink)" />
</Target>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably the way it was before...

But should this warn on all builds, or just Release builds? As-is, you'd only see it in Release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe. I was aiming for parity with current behavior. I made a change that should run this one for all builds.

Just a heads up that I'm planning to migrate more steps - I'll probabliy default to running them only where ILLink runs to avoid impacting Release builds, but happy to take feedback.

Address PR feedback: move _CheckForObsoletePreserveAttribute target from
ILLink.targets to AssemblyResolution.targets so it runs on all builds,
not just Release/trimmed builds. This gives developers earlier feedback
about using the obsolete attribute.
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.

2 participants