© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
12 replies
WhiteBlackGoose

❔ [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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

JumpList PublishAOT
C#CC# / help
2y ago
PublishSingleFile, PublishTrimmed and SelfContained .. breaks serilog (Reflection issue?)
C#CC# / help
3y ago
System.Speech incompatible with PublishSIngleFile / PublishTrimmed
C#CC# / help
3y ago
❔ How does the application created by PublishSingleFile work?
C#CC# / help
4y ago