Skip to content

dotnet test might clash with tested code that loads Microsoft.Build deps #15036

Closed
@JanKrivanek

Description

@JanKrivanek

Repro

    C:\Program Files\dotnet\sdk\9.0.202\Microsoft.TestPlatform.targets(48,5): warning : [xUnit.net 00:00:01.78] Skipping: StructuredLogger.Tests (could not find dependent assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0')
    C:\Program Files\dotnet\sdk\9.0.202\Microsoft.TestPlatform.targets(48,5): warning : No test is available in C:\src\binlog-viewer\bin\StructuredLogger.Tests\Debug\net472\StructuredLogger.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

Test summary: total: 0, failed: 0, succeeded: 0, skipped: 0, duration: 2.8s

Analysis

The tested code loads different version of the binary that the runner complains about

Image

So they probably clash?

E.g. if you'd remove all the rests and keep just https://github.com/JanKrivanek/MSBuildStructuredLog/blob/dev/jankrivanek/testgen__0326_003/src/StructuredLogger.Tests/StructuredLoggerTests.cs - it still fails, untill you remove the TestableStructuredLogger

Blocking?

Luckily not now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions