Reputation: 525
I have a WinUi 3 (c#)solution that contains 3 projects: A, B, C.
A: main application(exe) depends on B,C.
B: dll project depends on C.
c: dll project.
Now I like to build the solution as a unpacked application and pack it into a wix installer, so I want to reduce the file number of unpacked application as much as I can.
I added following property in project file of A for building.
<WindowsPackageType>None</WindowsPackageType>
Here is the output folder after building:
B.dll
B.pri
A.deps.json
A.dll
A.exe
A.pri
A.runtimeconfig.json
C.dll
C.pri
WinUI.Icon.dll
WinUI.Token.dll
Microsoft.Extensions.DependencyInjection.Abstractions.dll
Microsoft.Extensions.DependencyInjection.dll
Microsoft.InteractiveExperiences.Projection.dll
Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
Microsoft.Windows.ApplicationModel.Resources.Projection.dll
Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
Microsoft.Windows.AppLifecycle.Projection.dll
Microsoft.Windows.AppNotifications.Builder.Projection.dll
Microsoft.Windows.AppNotifications.Projection.dll
Microsoft.Windows.PushNotifications.Projection.dll
Microsoft.Windows.SDK.NET.dll
Microsoft.Windows.Security.AccessControl.Projection.dll
Microsoft.Windows.System.Power.Projection.dll
Microsoft.Windows.System.Projection.dll
Microsoft.Windows.Widgets.Providers.Projection.dll
Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
Microsoft.WinUI.dll
Microsoft.Xaml.Interactions.dll
Microsoft.Xaml.Interactivity.dll
WinRT.Runtime.dll
CommunityToolkit.Mvvm.dll
Removed // put unneeded files in this folder
runtimes // folder contains win10-x64\native\Microsoft.WindowsAppRuntime.Bootstrap.dll
Assets // contains the jpg and icon files referenced by application.
Here are the files I put in the "Removed" folder cause the application can be launched without them.
Question:
Is this the best I can do? Is it possible to remove following files or folder?
Upvotes: 1
Views: 334
Reputation: 1
currently this is not possible, but mybe you can use vs post-build event for removing languages folder, however if you want to reduce your app size, best option is to use Trimming https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained
Upvotes: 1