Single-file executable can't find dependency DLL in its folder
The intent is to publish a single-file executable which loads its runtime/native dependencies dynamically from the folder it is located in. I have ensured that those versions of the dependencies are placed in the same folder as the output.
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'TerraFX.Interop.Windows, Version=10.0.26100.2, Culture=neutral, PublicKeyToken=35b01b53313a6f7e'. The system cannot find the file specified.File name: 'TerraFX.Interop.Windows, Version=10.0.26100.2, Culture=neutral, PublicKeyToken=35b01b53313a6f7e'
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'TerraFX.Interop.Windows, Version=10.0.26100.2, Culture=neutral, PublicKeyToken=35b01b53313a6f7e'. The system cannot find the file specified.File name: 'TerraFX.Interop.Windows, Version=10.0.26100.2, Culture=neutral, PublicKeyToken=35b01b53313a6f7e'
There is no issue in Debug. The dependencies are placed in the output folder by an earlier-building project which is also
win-x86
win-x86
, has the same PackageReferences, down to the version (minus the ExcludeAssets bit). Is there any obvious reason why this would occur that I am missing?