chore: migrate test project from xunit v2 to xunit.v3#122
Merged
Conversation
Replace xunit 2.9.3 with xunit.v3 3.2.2 and bump Xunit.StaFact from 1.1.11 to 3.0.13. StaFact 2.x+ targets xunit v3; running both v2 and v3 in the same project causes CS0433 type-ambiguity errors on [Fact], [Collection], and related attributes. No test code changes needed — [StaFact], [StaTheory], [Fact], [Theory], [InlineData], [Collection], [CollectionDefinition], and all Assert.* calls are source-compatible between v2 and v3. Resolves the build failure on Dependabot PR #84. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
xunit.v3 (via xunit.v3.core.mtp-v1) injects a buildTransitive props file that sets UseAppHost=true. Combined with the existing RuntimeIdentifier=win-x64, the .NET 8 SDK treats the test project as a non-self-contained executable referencing a self-contained project (QuickMail.csproj), which triggers NETSDK1151. Explicitly setting SelfContained=true matches the main project and satisfies the SDK constraint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
xunit 2.9.3withxunit.v3 3.2.2Xunit.StaFactfrom1.1.11to3.0.13Why
Xunit.StaFact2.x+ targets xunit v3. Running bothxunit(v2) and the v3 core pulled in by StaFact in the same project causesCS0433type-ambiguity errors on[Fact],[Collection], and related attributes. This failure first appeared on Dependabot PR #84 after yesterday's merges added new test files.Rather than pin StaFact to the last xunit-v2-compatible release (1.2.69), this migrates the full test project to xunit.v3, which is the current/maintained path.
Test plan
[StaFact]and[StaTheory]STA-thread WPF tests run correctlyCloses Dependabot PR #84.
Generated with Claude Code