❔ [SOLVED] PublishAot and PublishSingleFile at thesame time

I have a very simple app and I want to reduce its size and have a good start up time. Here's my current publish script:
dotnet publish \
-r $1 \
-c release \
-o ./native-out \
-p:PublishReadyToRun=true \
-p:SelfContained=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:TrimMode=link
dotnet publish \
-r $1 \
-c release \
-o ./native-out \
-p:PublishReadyToRun=true \
-p:SelfContained=true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-p:TrimMode=link
I do R2R, but I'd like to use PublishAot instead, which returns an error that it cannot use PublishAot and PublishSingleFile at the same time. What's the latest way to reduce size as much as possible and have a good start up time? SDK 7.0.100
3 Replies
ero
ero3y ago
i believe PublishSingleFile is only for executables, PublishAot is only for libraries so naturally you can't combine them at least as far as i know
WhiteBlackGoose
WhiteBlackGooseOP3y ago
oh 🤔 I don't see mentions of library for publishaot ah wait native aot implies compiling into a single file https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/#limitations-of-native-aot-deployment ok, the compiled executable is blazingly fast but it's huge, 33mb okay anyway this one is solved
Accord
Accord3y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server