Open JasonWei512 opened 1 year ago
CommunityToolkit is not compatible with trimming. Either removing usages to CommunityToolkit or rooting all assemblies from CommunityToolkit.
TaskScheduler is not compatible with IL trimming (because of COM™): https://github.com/dahall/TaskScheduler/issues/948
Energy Star X uses TaskScheduler
to get the status of the admin startup task from Windows Task Scheduler. (MSIX's StartupTask
doesn't allow you to run an app at startup AS ADMIN, so I have to use a schedule task for this.)
If I remove TaskScheduler
from dependencies and set TrimMode
to partial
, then this app can run. No TrimmerRootAssembly
needed.
Some experiments on optimize/IL-trimming
branch:
Before (MB) | After (MB) | |
---|---|---|
Unpackaged | 146 | 65 |
MSIX | 57 | 29 |
Looks like IL trimming breaks Visual Studio App Center SDK. https://github.com/microsoft/appcenter/issues/2517
似乎trimming对带UI的.NET程序的支持性都不佳。
The problem you want to solve / 你想要解决的问题
App size is too big (150 MB). 应用大小太大了(150 MB)。
Possible solution / 可能的解决方法
Windows App SDK 1.2 now supports .NET IL trimming, which can help reduce binary size. https://learn.microsoft.com/windows/apps/windows-app-sdk/stable-channel#trimming-for-apps-developed-with-net
However when I enabled trimming, this app will crash on launch. https://github.com/microsoft/WindowsAppSDK/issues/2478 https://github.com/microsoft/CsWinRT/issues/373
Windows App SDK 1.2 现在支持 .NET IL 裁剪了,这可以帮助减小二进制大小。 https://learn.microsoft.com/windows/apps/windows-app-sdk/stable-channel#trimming-for-apps-developed-with-net
但是当我启用裁剪时,应用启动时会崩溃。 https://github.com/microsoft/WindowsAppSDK/issues/2478 https://github.com/microsoft/CsWinRT/issues/373
Additional context / 其他信息
There's also a bug with TeachingTip in Windows App SDK 1.2. https://github.com/microsoft/microsoft-ui-xaml/issues/7937 https://github.com/microsoft/microsoft-ui-xaml/issues/8003
Windows App SDK 1.2 的 TeachingTip 也有 Bug。 https://github.com/microsoft/microsoft-ui-xaml/issues/7937 https://github.com/microsoft/microsoft-ui-xaml/issues/8003