Skip to content

dotnet test -f net472 fails with net472/win-x86 error #1465

@AArnott

Description

@AArnott

I have a multitargeting test project: net472 and net8.0.
Both run tests fine with Visual Studio Test Explorer. But from the CLI, dotnet test only works on the .NET 8 target. The .NET Framework target fails with:

Nerdbank.MessagePack.Analyzers.Tests net472 failed with 1 error(s) (0.1s)
C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file 'D:\source\Nerdbank.MessagePack\obj\test\Nerdbank.MessagePack.Analyzers.Tests\project.assets.json' doesn't have a target for 'net472/win-x86'. Ensure that restore has run and that you have included 'net472' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers.

Does TUnit really bring in native binaries such that I need to commit my .NET Framework test projects to architecture specific builds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions