SelfContainedSlow

Defenders slows down .NET 6.0 SelfContained singleexe files

Code and Build

The c# program contains nothing

Console.WriteLine("Hello, World!");
Console.ReadLine();
dotnet publish -c Release -r win-x64 --output ./artifacts --self-contained true -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:CopyOutputSymbolsToPublishDirectory=false -p:EnableCompressionInSingleFile=true

How to Test

Result

Video when I open the file property dialog or starts the program

gif

Alt Text

mp4

Download video with better quality