Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Dec 2, 2024
1 parent bae6ecf commit 8943d5f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pyedb/dotnet/clr_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import sys
import warnings

from clr_loader import find_runtimes

import pyedb

LINUX_WARNING = (
Expand Down Expand Up @@ -81,14 +83,15 @@ def find_runtime_config(dotnet_root: Path) -> Path:
if dotnet_root.parent.name == "dotnetcore2":
runtime_config = pyedb_path / "misc" / "pyedb.runtimeconfig.json"
else:
try:
runtime_config = find_runtime_config(dotnet_root)
except Exception as e:
candidates = [rt for rt in find_runtimes() if rt.name == "Microsoft.NETCore.App"]
candidates.sort(key=lambda spec: spec.version, reverse=True)
if not candidates:
raise RuntimeError(
"Configuration file could not be found from DOTNET_ROOT. "
"Please ensure that .NET SDK is correctly installed or "
"that DOTNET_ROOT is correctly set."
)
runtime_config = candidates[0]
# Use specific .NET core runtime
if dotnet_root is not None and runtime_config is not None:
try:
Expand Down

0 comments on commit 8943d5f

Please sign in to comment.