Description
Description
Ref: https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/9.0/assembly-load-directory
This broke us pretty badly. We have two hundred fifty copies of the application on one server; so the entire application except for the config files is symbolic-linked in from a pile install. Due to differing version dependencies; it's not possible to run from the pile install at all; the symbolic tree is necessary to make any runnable directory structure.
"If your application relied on the previous behavior, ensure that all relevant binaries are located in the directory behind the symbolic link, rather than next to it."
This recommendation is eight years too late.
We had actually discovered the behavior was different on Linux and used a LD_PRELOAD to prevent the loader from noticing it was a symbolic link.
Reproduction Steps
There's no meaningful minimal reproduction for this one.
Expected behavior
Revert to .NET 8 behavior.
Actual behavior
Application fails to load altogether
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Failed to run as a self-contained app.
- The application was run as a self-contained app because 'C:\Program Files\Cedaron Form Builder\Shared\trees\Form Builder\10.0.3035.902\Cedaron.FormBuilder.WebAPI\sqlexec.runtimeconfig.json' did not specify a framework.
- If this should be a framework-dependent app, specify the appropriate framework in 'C:\Program Files\Cedaron Form Builder\Shared\trees\Form Builder\10.0.3035.902\Cedaron.FormBuilder.WebAPI\sqlexec.runtimeconfig.json'.
Fixing hostpolicy is possible but other things will go wrong. Everything depends on Path.GetDirectory(typeof(Program).GetAssemblyFileName) resolving the config files.
Regression?
Yes, .NET 8
Known Workarounds
We don't have one yet. Hard links ought to work but don't due to the inability to replace a file with multiple hard links atomically.
Configuration
.NET 9.0.4
Other information
No response
Metadata
Metadata
Assignees
Type
Projects
Status