Open
Description
In investigating size of NativeAOT apps, one area of additional size is app.UseDeveloperExceptionPage().
When comparing the win-x64 sizes before and after adding the app.UseDeveloperExceptionPage()
line, I see the following sizes:
8.99 MB (9,428,480 bytes) - AddRoutingCore()+app.UseRouting()+UseEndpoints+MapGet
9.56 MB (10,031,616 bytes) - AddRoutingCore()+app.UseRouting()+UseEndpoints+MapGet+app.UseDeveloperExceptionPage()
This means adding app.UseDeveloperExceptionPage()
adds about 550 KB of app size.
We should investigate if there is a way to make this feature smaller. One way to make it smaller is #46915. There may be other optimization we could make to reduce app size. For example, maybe eliminating System.Linq
usages. Another option is removing UseDeveloperExceptionPage()
from CreateSlimBuilder and make it optional for the app to add it (possibly putting it into the dotnet new api
template).