close
Skip to content

clr_loader.ffi.load_hostfxr might not load the latest version of hostfxr #38

@sdao

Description

@sdao

Environment

  • Pythonnet version: 3.0.0.post1
  • Python version: 3.7.7
  • Operating System: Windows 10 21H2
  • .NET Runtime: 5.0.17

Details

Depending on the contents of C:\Program Files\dotnet\host\fxr (or wherever the dotnet root is), clr_loader might pick up an older version of hostfxr based on the logic in def load_hostfxr(dotnet_root: Path)

e.g. if the contents of the folder are

2.1.7
3.1.26
5.0.5
5.0.17

then it doesn't pick up 5.0.17, but picks up 5.0.5 because Python's lexicographic sort will order the folder as ['2.1.7', '3.1.26', '5.0.17', '5.0.5'].

This is admittedly very minor, but we just ran into this and wanted to give a heads up :)
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions