File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,9 @@ def load_hostfxr(dotnet_root: Path):
18
18
hostfxr_name = _get_dll_name ("hostfxr" )
19
19
dotnet_root = dotnet_root .absolute ()
20
20
21
- # This will fail as soon as .NET hits version 10, but hopefully by then
22
- # we'll have a more robust way of finding the libhostfxr
21
+ # Find all hostfxr versions by looking for the library file in version subdirectories
23
22
hostfxr_path = dotnet_root / "host" / "fxr"
24
- hostfxr_paths = hostfxr_path .glob (f"?. */{ hostfxr_name } " )
23
+ hostfxr_paths = hostfxr_path .glob (f"*/{ hostfxr_name } " )
25
24
26
25
error_report = list ()
27
26
@@ -69,7 +68,9 @@ def load_netfx():
69
68
def _path_to_version (path : Path ) -> Tuple [int , int , int ]:
70
69
name = path .parent .name
71
70
try :
72
- res = list (map (int , name .split ("." )))
71
+ # Handle pre-release versions like "10.0.0-rc.1" by taking only the version part
72
+ version_part = name .split ("-" )[0 ]
73
+ res = list (map (int , version_part .split ("." )))
73
74
return tuple (res + [0 , 0 , 0 ])[:3 ]
74
75
except Exception :
75
76
return (0 , 0 , 0 )
You can’t perform that action at this time.
0 commit comments