Repository navigation
Skip runtimes, native and satellite files in AssemblyFinder on every platform (#1143) - #1145
Merged
Merged
Conversation
…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>
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1143.
The bug
AssemblyFinderskipped files whose full path contained"/runtimes"or"/native":Directory.EnumerateFilesreturns\-separated paths, so the check never matched. Every native DLL underruntimes\<rid>\native(covrun64.dll,msdia140.dll, …) was tried withLoadFromAssemblyNameand thenLoadFromAssemblyPath, failing both times on every host start. The reporter saw thousands of these in a test process with many in-process hosts, ending in the runtime hang filed as Repeated failed LoadFromAssemblyPath on a native DLL ends in 'Stack overflow.' and a hung process instead of BadImageFormatException dotnet/runtime#137153./opt/native-tools/app/) had every file skipped.The fix
AssemblyFinder.ShouldSkipFile(relativePath)looks only at the path relative to the scanned folder:runtimesornative. Both/and\are split on, and case is ignored.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.dllsuffix and by sitting in a subfolder, so a top-levelCompany.Resources.dllis still scanned.Tests
CoreTests/TypeScanning/AssemblyFinderTests:native.dll,runtimes-config/..., top-levelCompany.Resources.dll). These run on every OS.runtimes/.../native,native/andde/, plus one visible junk DLL, asserting that only the visible one is attempted. The folder sits undernative-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