Skip to content

Fix .NET Framework build: exclude TrimmingTests from compilation#130892

Open
svick with Copilot wants to merge 3 commits into
mainfrom
copilot/dotnet-framework-build-fix
Open

Fix .NET Framework build: exclude TrimmingTests from compilation#130892
svick with Copilot wants to merge 3 commits into
mainfrom
copilot/dotnet-framework-build-fix

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

HybridCacheEntryOptionsAccessorTest.cs uses UnsafeAccessorAttribute/UnsafeAccessorKind (.NET 8+ only), but the test project targets both $(NetCoreAppCurrent) and $(NetFrameworkCurrent) (net481) with EnableDefaultItems=true, causing the trimming test to be compiled against .NET Framework where those types don't exist.

Fix: Add <Compile Remove="TrimmingTests\**" /> to Microsoft.Extensions.Caching.Abstractions.Tests.csproj.

Copilot AI requested review from Copilot and removed request for Copilot July 16, 2026 17:27
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
15 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI linked an issue Jul 16, 2026 that may be closed by this pull request
…ation

Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 16, 2026 17:33
Copilot AI changed the title [WIP] Fix .NET Framework build failure in caching abstractions Fix .NET Framework build: exclude TrimmingTests from netfx compilation Jul 16, 2026
Copilot finished work on behalf of svick July 16, 2026 17:34
Copilot AI requested a review from svick July 16, 2026 17:34
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-caching
See info in area-owners.md if you want to be subscribed.

Co-authored-by: svick <287848+svick@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 16, 2026 18:41
Copilot finished work on behalf of svick July 16, 2026 18:41
@svick
svick marked this pull request as ready for review July 16, 2026 18:48
Copilot AI review requested due to automatic review settings July 16, 2026 18:48
@svick
svick enabled auto-merge (squash) July 16, 2026 18:48
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@svick
svick requested review from mrek-msft and rosebyte July 16, 2026 18:48
Copilot AI temporarily deployed to copilot-pat-pool July 16, 2026 18:49 Inactive
Copilot AI temporarily deployed to copilot-pat-pool July 16, 2026 18:49 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the Microsoft.Extensions.Caching.Abstractions.Tests test project’s default item inclusion so that sources under TrimmingTests/ are not compiled as part of the xUnit test assembly, avoiding build breaks when targeting .NET Framework.

Changes:

  • Exclude TrimmingTests\** sources from compilation via a Compile Remove item.
  • Document that TrimmingTests are built as standalone console apps via a dedicated *.TrimmingTests.proj.

@svick svick changed the title Fix .NET Framework build: exclude TrimmingTests from netfx compilation Fix .NET Framework build: exclude TrimmingTests from compilation Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET Framework build appears broken

3 participants