Skip to content

fix: include ApprovalTests as transitive dependency#17

Merged
Arthurvdv merged 1 commit into
masterfrom
fix/include-approvaltests-runtime
Apr 25, 2026
Merged

fix: include ApprovalTests as transitive dependency#17
Arthurvdv merged 1 commit into
masterfrom
fix/include-approvaltests-runtime

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Problem

DiffHelper.TryToReportDiffWithExternalTool throws FileNotFoundException for ApprovalTests assembly when consumer test projects hit a code-action diff mismatch. This is because ApprovalTests was marked with PrivateAssets="all" and its runtime assets were excluded.

Fix

  • Removed PrivateAssets="all" so ApprovalTests flows as a transitive dependency to consumers
  • Changed ExcludeAssets to "build;buildTransitive" (retains exclusion of MSBuild targets that may affect deterministic compilation)
  • Applied to all 3 TFM-specific ApprovalTests PackageReference entries (netstandard2.1, net8.0, net10.0)

Verification

  • Builds successfully for netstandard2.1 and net8.0 (net10.0 has pre-existing BC DevTools DLL issue locally, works in CI)
  • dotnet-validate deterministic check expected to pass (build targets still excluded)

Remove PrivateAssets="all" and reduce ExcludeAssets to "build;buildTransitive"
on all three TFM-specific ApprovalTests PackageReference entries.

Previously, ApprovalTests was fully excluded from runtime assets, causing
FileNotFoundException when DiffHelper.TryToReportDiffWithExternalTool tried
to instantiate DiffReporter in consumer test projects.

The build/buildTransitive exclusion is retained to prevent ApprovalTests'
MSBuild targets from interfering with deterministic compilation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Arthurvdv Arthurvdv merged commit 231426b into master Apr 25, 2026
1 check passed
@Arthurvdv Arthurvdv deleted the fix/include-approvaltests-runtime branch April 25, 2026 15:36
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