On Fri May 1 20:34:33 2026 +0000, Nikolay Sivov wrote:
Aren't those .config files a .NET specific thing, which should be handled by .NET itself? Well that's also my original thought so it took a while for me to prove that SxS loader has its own .config file. First is the microsoft doc I linked in the PR is under SxS API doc.
Second is that I wrote this small native C++ project. ```cpp #include <iostream> #include <Windows.h> int main() { typedef int(__stdcall* NativeAddFn)(int, int); HMODULE module = ::LoadLibraryW(L"nativeleaf.dll"); if (!module) { DWORD err = ::GetLastError(); std::cout << "LoadLibraryW Failed " << err; return 2; } FARPROC proc = ::GetProcAddress(module, "NativeAdd"); if (!proc) { DWORD err = ::GetLastError(); std::cout << "GetProcAddress Failed " << err; return 2; } NativeAddFn add_fn = reinterpret_cast<NativeAddFn>(proc); std::cout << add_fn(12, 30); ::FreeLibrary(module); } ``` embed this manifest into the program ```xml <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level='asInvoker' uiAccess='false' /> </requestedPrivileges> </security> </trustInfo> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='my_plugins' version='1.0.0.0' processorArchitecture='*' language='*' /> </dependentAssembly> </dependency> </assembly> ``` and name the exe as test.exe, create a config file called test.exe.config in the same folder ```xml <configuration> <windows> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="plugins"/> </assemblyBinding> </windows> </configuration> ``` create native.dll, essentially contains this ```cpp extern "C" __declspec(dllexport) int __stdcall NativeAdd(int a, int b) { return a + b; } ``` and its manifest ```xml <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion="1.0"> <assemblyIdentity type="win32" processorArchitecture="AMD64" name="my_plugins" version="1.0.0.0"/> <file name="native.dll"/> </assembly> ``` finally arrange everything in this way ``` test.exe test.exe.config plugins/ ├─ native.dll ├─ my_plugins.manifest ``` and on windows, test.exe will run and print 42. If you remove the config file it will throw SxS loader error. Finally, if you use sxstrace to trace the program, you'll see this line in the input parameters ``` Application Config File = C:\Users\Public\native.exe.Config ``` so indeed SxS loader is reading the config file. Also notice that SxS config is using `<windows></windows>` not `<runtime></runtime>` in .NET applications, so .NET config doesn't work here. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10753#note_138569