Skip to content

Adding System.Reactive to WinUI3/MAUI app increases package size by 44MB because it includes WPF and WinForms references #1745

@DeanFaizal

Description

@DeanFaizal

Bug

Which library version?
System.Reactive 5.0.0

What are the platform(s), environment(s) and related component version(s)?
WinUI3, MAUI

What is the use case or problem?
Using System.Reactive in WinUI3 app

What is the expected outcome?
Only required references for the platform are included in app package

What is the actual outcome?
The app package increases from 44MB to 88MB with the following additional dlls in the package:

"Accessibility.dll"
"D3DCompiler_47_cor3.dll"
"DirectWriteForwarder.dll"
"Microsoft.VisualBasic.Forms.dll"
"Microsoft.Win32.Registry.AccessControl.dll"
"Microsoft.Win32.SystemEvents.dll"
"PenImc_cor3.dll"
"PresentationCore.dll"
"PresentationFramework.Aero.dll"
"PresentationFramework.Aero2.dll"
"PresentationFramework.AeroLite.dll"
"PresentationFramework.Classic.dll"
"PresentationFramework.dll"
"PresentationFramework.Luna.dll"
"PresentationFramework.Royale.dll"
"PresentationFramework-SystemCore.dll"
"PresentationFramework-SystemData.dll"
"PresentationFramework-SystemDrawing.dll"
"PresentationFramework-SystemXml.dll"
"PresentationFramework-SystemXmlLinq.dll"
"PresentationNative_cor3.dll"
"PresentationUI.dll"
"ReachFramework.dll"
"System.CodeDom.dll"
"System.Configuration.ConfigurationManager.dll"
"System.Design.dll"
"System.Diagnostics.EventLog.dll"
"System.Diagnostics.PerformanceCounter.dll"
"System.DirectoryServices.dll"
"System.Drawing.Common.dll"
"System.Drawing.Design.dll"
"System.IO.Packaging.dll"
"System.Printing.dll"
"System.Reactive.dll"
"System.Resources.Extensions.dll"
"System.Security.Cryptography.Pkcs.dll"
"System.Security.Cryptography.ProtectedData.dll"
"System.Security.Cryptography.Xml.dll"
"System.Security.Permissions.dll"
"System.Threading.AccessControl.dll"
"System.Windows.Controls.Ribbon.dll"
"System.Windows.Extensions.dll"
"System.Windows.Forms.Design.dll"
"System.Windows.Forms.Design.Editors.dll"
"System.Windows.Forms.dll"
"System.Windows.Forms.Primitives.dll"
"System.Windows.Input.Manipulations.dll"
"System.Windows.Presentation.dll"
"System.Xaml.dll"
"UIAutomationClient.dll"
"UIAutomationClientSideProviders.dll"
"UIAutomationProvider.dll"
"UIAutomationTypes.dll"
"vcruntime140_cor3.dll"
"WindowsFormsIntegration.dll"
"wpfgfx_cor3.dll"

These seem to be localization folders:
"cs"
"de"
"es"
"fr"
"it"
"ja"
"ko"
"pl"
"pt-BR"
"ru"
"tr"
"zh-Hans"
"zh-Hant"

Inside each localization folder:
"System.Windows.Input.Manipulations.resources.dll"
"System.Xaml.resources.dll"
"UIAutomationClient.resources.dll"
"UIAutomationClientSideProviders.resources.dll"
"UIAutomationProvider.resources.dll"
"UIAutomationTypes.resources.dll"
"WindowsBase.resources.dll"
"WindowsFormsIntegration.resources.dll"
"Microsoft.VisualBasic.Forms.resources.dll"
"PresentationCore.resources.dll"
"PresentationFramework.resources.dll"
"PresentationUI.resources.dll"
"ReachFramework.resources.dll"
"System.Windows.Controls.Ribbon.resources.dll"
"System.Windows.Forms.Design.resources.dll"
"System.Windows.Forms.Primitives.resources.dll"
"System.Windows.Forms.resources.dll"

What is the stacktrace of the exception(s) if any?
N/A

Do you have a code snippet or project that reproduces the problem?

  1. Create a File > New MAUI app
  2. Update OnCounterClicked
    private void OnCounterClicked(object sender, EventArgs e)
    {
        var source = Observable.Timer(DateTimeOffset.MinValue, TimeSpan.FromSeconds(1)).Timestamp();
        source.Subscribe(x =>
        Application.Current.Dispatcher.Dispatch(() =>
        {
            CounterLabel.Text = x.Timestamp.ToString();
        }));
        SemanticScreenReader.Announce(CounterLabel.Text);
    }
  1. Add System.Reactive nuget or the following in csproj:
	<ItemGroup>
	  <PackageReference Include="System.Reactive" Version="5.0.0" />
	</ItemGroup>
  1. Build the app in command prompt
msbuild MauiReactive.sln -restore -p:Configuration=Release
  1. Package the app in command prompt
"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\MakeAppx" pack /v /h SHA256 /d "MauiReactive\bin\Release\net6.0-windows10.0.19041\win10-x64" /p MauiReactive.msix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions