Skip to content

Skip runtimes, native and satellite files in AssemblyFinder on every platform (#1143) - #1145

Merged
jeremydmiller merged 1 commit into
mainfrom
fix/1143-assemblyfinder-windows-separators
Nov 8, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
fix/1143-assemblyfinder-windows-separators

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #1143.

The bug

AssemblyFinder skipped files whose full path contained "/runtimes" or "/native":

The fix

AssemblyFinder.ShouldSkipFile(relativePath) looks only at the path relative to the scanned folder:

  • It skips any file under a folder segment named runtimes or native. Both / and \ are split on, and case is ignored.
  • It also skips satellite resource assemblies (de/App.resources.dll). They hold no types and fail to load by name on every platform. A satellite is recognised by the build's lower-case .resources.dll suffix and by sitting in a subfolder, so a top-level Company.Resources.dll is still scanned.

Tests

CoreTests/TypeScanning/AssemblyFinderTests:

  • Theory cases for the predicate with both separator styles, covering what is skipped and near-misses that are kept (native.dll, runtimes-config/..., top-level Company.Resources.dll). These run on every OS.
  • A scan of a temporary folder holding junk files under runtimes/.../native, native/ and de/, plus one visible junk DLL, asserting that only the visible one is attempted. The folder sits under native-app/. With the old check restored this test fails, even on macOS.

The full CoreTests suite passes locally on net9.0 and net10.0.

🤖 Generated with Claude Code

…platform (#1143)

The skip compared the full path against "/runtimes" and "/native", so it never
matched the '\'-separated paths Directory.EnumerateFiles returns on Windows, and
every native DLL under runtimes\<rid>\native was tried by name and then by path.
On Linux the same full-path test skipped the whole scan when the application
lived under a folder whose name began with "native".

Compare the folder segments below the scanned folder instead, splitting on both
separators, and also pass over satellite resource assemblies in culture folders,
which hold no types and fail to load by name on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

AssemblyFinder doesn't skip runtimes/native folders on Windows: the check looks for '/runtimes' with a forward slash

1 participant