You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TPA duplicate simple names prefer the last entry after #122643, causing native EXEs to shadow managed DLLs #132588
PR #122643 removed the “first entry wins” behavior when constructing the Trusted Platform Assemblies map. ApplicationContext::SetupBindingPaths now unconditionally calls AddOrReplace, so the final TPA entry for a simple name wins.
If TPA contains:
C:\app\vsdbg-ui.dll;C:\app\vsdbg-ui.exe
the entry for vsdbg-ui.exe replaces vsdbg-ui.dll. A subsequent call to:
Initialize CoreCLR with a TPA list containing a managed DLL followed by a native EXE with the same simple name.
Call coreclr_create_delegate using that simple name.
Observed results:
Runtime
Result
.NET 8
S_OK
.NET 11 dev
0x80070002
Removing the native EXE from TPA makes the .NET 11 call succeed.
This was also reproduced with a standalone native host, independently of the original debugger application.
Expected behavior
A native EXE should not replace a valid managed DLL with the same simple name in the TPA map. At minimum, DLL entries should remain preferred over EXE entries, matching the previous behavior and hostpolicy’s documented “pick DLL over EXE” policy.
Proposed fix
Restore duplicate handling in SetupBindingPaths, independently of the removed native-image logic:
Prefer .dll over .exe.
Preserve the first entry when duplicate entries have equivalent priority.
A regression test should provide Example.dll;Example.exe in TPA and verify that binding Example loads the DLL.
Activity
Restore TPA duplicate precedence to keep managed DLLs over native EXEs (
Restore TPA duplicate precedence to keep managed DLLs over native EXEs (