Skip to content

[Bug]: Compile error CS0121 on .NET 8 #6296

Description

@PBeckmann-prohandel

Description

We compile our product in a .NET 8.0 environment and get error CS0121: The call is ambiguous between the following methods or properties: with the latest version of TUnit.

Expected Behavior

No compilation error

Actual Behavior

Compilation error CS0121

Steps to Reproduce

global.json

{
  "sdk": {
    "version": "8.0.422",
    "rollForward": "latestFeature"
  }
}
[Test]
public async Task Guid_IsEqualTo_IsAmbiguous_OnSdk8(CancellationToken cancellationToken)
{
    var expected = Guid.Parse("11111111-1111-1111-1111-111111111111");
    var actual = Guid.Parse("11111111-1111-1111-1111-111111111111");

    // CS0121: ambiguous between IsEqualTo<TValue, TOther> and IsEqualTo<TValue>
    await Assert.That(actual).IsEqualTo(expected);
}

TUnit Version

1.56.25

.NET Version

.NET 8.0

Operating System

Linux

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

error CS0121: The call is ambiguous between the following methods or properties: 'EqualsAssertionExtensions.IsEqualTo<TValue, TOther>(IAssertionSource<TValue>, TOther?, string?)' and 'EqualsAssertionExtensions.IsEqualTo<TValue>(IAssertionSource<TValue>, TValue?, string?)'

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions