Michael Lukin
Michael Lukin

Reputation: 889

Why is Dot Net Avalonia hello-world application so huge (80 MB)?

Create a default Dot Net Avalonia MVVM application project in MSVS 2022.

Build ready-to-publish release version using command dotnet publish .\AvaloniaApplication1.csproj -r win-x64 -c Release -p:publishsinglefile=true --self-contained true -p:debugsymbols=false -p:debugtype=none -o HelloWorld

We got a release of three files with overall size 84.6 MB.

I believe the size of hello-world GUI project should not exceed 1 MB. Is it possible? Or, at least, how to reduce the size as much as possible?

Upvotes: 1

Views: 1430

Answers (1)

Matt Evans
Matt Evans

Reputation: 7575

At a guess, this is your issue:

--sc|--self-contained [true|false]

Publishes the .NET runtime with your application

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish

Maybe you need to do this, maybe not

Upvotes: 3

Related Questions