Skip to content

TestAssemblyResolver not working for .NET 10.0.0 (FindBestVersionDir) #1780

@IRebo

Description

@IRebo

Im using the current version3 branch and console runner net462 (not netcore).

Trying to run nunit test which references windows forms fails with :

Unable to load one or more of the requested types.
Could not load file or assembly 'System.Windows.Forms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
----> Could not load file or assembly 'System.Windows.Forms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.

The reason is that TestAssemblyResolver is refusing to use "C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\10.0.0" for an assembly with version 10.0.0.0.

The function FindBestVersionDir will try to compare new System.Version("10.0.0") >= new System.Version("10.0.0.0") which returns false. Because the revision number in the 10.0.0 is not defined the version is considered lower than any version that has a revision number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    V3All issues related to V3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions