-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single-File host does not correctly redirect hostpolicy PInvokes #39907
Comments
Tagging subscribers to this area: @swaroop-sridhar, @agocke |
I spent some time today looking into this:
I got it working in a hacky way on Windows as a proof of concept (the special cased library returns |
There's a managed component
AssemblyDependencyResolver
which is implemented by PInvoking intohostpolicy
. Since in the new single-file thehostpolicy
doesn't exist as a separate module, we need to redirect the PInvokes to the main module, just like we do for other statically linked libraries.Note that this needs to work on Windows as well - which is different from the case we already implement which is Linux only.
Repro:
Run as a single-file self-contained console app. i.e.
dotnet publish -r win-x64 /p:PublishSingleFile=true
. The result is:It will work if published as FDD single-file i.e.
dotnet publish -r win-x64 --self-contained false /p:PublishSingleFile=true
- this will now fail with error about not findingpath.dll
.I verified that it behaves the same on Linux with the latest RC from installers.
The text was updated successfully, but these errors were encountered: