❔ [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
ero2y 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
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
Accord2y 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
More Posts
❔ ASP.NET Core Middleware running only onceHello! I have a custom middleware that runs only once and isn't running on every request. When I pu❔ ❔ Upgrading my function app to .NET 7 - Could not load file or assembly System.ComponentModelI've tried to upgrade my Azure Function App to .NET 7. But `Microsoft.Azure.WebJobs.Extension.Stora❔ How to set a time interval in a timer ?This is the class: ```csharp public string ProcessName { get; set; } public int MaximumLifeTime { ge❔ EntityFramework does not track changes for the select projectionHey, With Select (), I only extracted the data I needed, which I want to update later. However, afte❔ Using concurrent collections to add or remove elements for in-memory collections (server)?Should we use concurrent collections to add/remove elements to/from in-memory collections in asp.net❔ .NET 6 GET method returns OK even if there is no such endpointI've a .NET 6 Web Application with Blazor wasm front-end. When I make an HTTP GET request from froSolvedI have made a square root calculator It works when someone enters an invalid Input to the square roHow to set a 15 seconds timeonly type varible ?I want to archive something like in the image❔ yaml parser with native aotis there any yaml parser library that supports native aot? i tried yamldotnet but it doesnt work witHow would I check if a generic type is unmanaged, then pass it to a method with where T ; unmanaged?I have a method that needs to call different methods based on whether T is managed or not. I'm not s