Skip to content

Nest snapshots by updating the SDK's None items - #1911

Merged
SimonCropp merged 1 commit into
mainfrom
nest-snapshots-with-none-update
Sep 4, 2026
Merged

Nest snapshots by updating the SDK's None items#1911
SimonCropp merged 1 commit into
mainfrom
nest-snapshots-with-none-update

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Verify.AfterMicrosoftNetSdk.props added a None item per snapshot to carry DependentUpon, on top of the item the SDK's */ glob had already produced. So every snapshot sat in None twice. DotNetProjectFile.Analyzers copies @(None) into Content for its SonarQube integration in non-IDE builds, which turned those into duplicate Content items and failed the build with NETSDK1022.

The metadata is now applied with None Update to the SDK's item. The Include remains only for snapshots the SDK did not glob, such as when default items are disabled.

FileNestingTests run the SDK's CheckForDuplicateItems target alongside the item evaluation, fail on any file listed twice, and cover a project that promotes None to Content as well as one that declares html snapshots as Content itself.

VerifyTests/Verify.Bunit#108

Verify.AfterMicrosoftNetSdk.props added a None item per snapshot to carry
DependentUpon, on top of the item the SDK's **/* glob had already produced.
So every snapshot sat in None twice. DotNetProjectFile.Analyzers copies
@(None) into Content for its SonarQube integration in non-IDE builds, which
turned those into duplicate Content items and failed the build with
NETSDK1022.

The metadata is now applied with None Update to the SDK's item. The Include
remains only for snapshots the SDK did not glob, such as when default items
are disabled.

FileNestingTests run the SDK's CheckForDuplicateItems target alongside the
item evaluation, fail on any file listed twice, and cover a project that
promotes None to Content as well as one that declares html snapshots as
Content itself.

VerifyTests/Verify.Bunit#108
@SimonCropp
SimonCropp merged commit f92712d into main Sep 4, 2026
6 checks passed
@SimonCropp
SimonCropp deleted the nest-snapshots-with-none-update branch September 4, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant