Self-contained, trimmed .NET 9 executable "can't find framework" when run
I'm attempting to publish a project with two NuGet dependencies (one with native libraries) as a single-file, trimmed executable.
I am using the following profile with the command-line
dotnet.exe publish $FOLDER_CONTAINING_PROJECT --no-build -c "Release" /p:PublishProfileFullPath=PATH_TO_PROFILE --self-contained
:
but running the finished artifact produces:
To clarify:
1) Aren't self-contained executables supposed to not require .NET to be installed in the first place?
2) Given Microsoft.NETCore.App
>= 9.0.0 x64 evidently is installed, how can it not be found?
3) Is there something incorrect with either the project or publish settings that would prohibit this from working?1 Reply
sfextract
over the resulting image does show some runtime assemblies in:
Not using a publish profile (moving any needed directives into the project file) doesn't seem to change a thing.
This is the output running with COREHOST_TRACE
on. https://gist.github.com/fkelava/b28ca32ffadd1779a1af81d2360fd78d
Why exactly does it think the .NET location is the folder I'm running it in? How does that work?