Skip to content

Fix .NET DLL loading and deduplicate init code#97

Merged
mircealungu merged 1 commit into
masterfrom
fix/dotnet-loading
Mar 21, 2026
Merged

Fix .NET DLL loading and deduplicate init code#97
mircealungu merged 1 commit into
masterfrom
fix/dotnet-loading

Conversation

@mircealungu
Copy link
Copy Markdown
Contributor

Summary

  • Fixed .NET assembly loading that was broken on macOS (and likely everywhere via pip install)
  • Root causes: missing runtimeconfig.json and wrong clr.AddReference usage (file paths instead of assembly names + sys.path)
  • Auto-detects DOTNET_ROOT on macOS Homebrew so users don't need to set it manually
  • Extracted the duplicated dotnet init block (was copy-pasted 4 times) into _init_dotnet() helper

Fixes #84, fixes #96

Test plan

  • archlens render on a Java/C# project works without manually setting DOTNET_ROOT
  • archlens render on a Python project still works (no regression)
  • Works from both dev install and pip install

🤖 Generated with Claude Code

- Generate runtimeconfig.json via csproj setting
- Use assembly names with sys.path instead of file paths for clr.AddReference
- Auto-detect DOTNET_ROOT on macOS Homebrew
- Extract duplicated dotnet init block into _init_dotnet() (fixes #84)
- Fixes #96

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

ArchLens - No architecturally relevant changes to the existing views

@mircealungu mircealungu merged commit 8dfdc54 into master Mar 21, 2026
3 checks passed
@mircealungu mircealungu requested review from BabetteB and lottejd March 21, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pythonnet clr.AddReference fails to load DLLs on macOS Extract duplicated dotnet initialization into helper function

1 participant