Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trimmable - Winforms crash on startup #2455

Open
Doprez opened this issue Sep 18, 2024 · 1 comment
Open

Trimmable - Winforms crash on startup #2455

Doprez opened this issue Sep 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Doprez
Copy link
Contributor

Doprez commented Sep 18, 2024

Release Type: Official Release

Version: 4.2.0.2188

Platform(s): Windows

Describe the bug
Publish Trimmable seems to remove something that Winforms needs to properly function.

To Reproduce
Steps to reproduce the behavior:

  1. use a default project
  2. publish with the trimmable option set to true Publish Trimmable

Expected behavior
Crash bad. No crash good.

Log and callstacks

System.InvalidCastException: Specified cast is not valid.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
   at Windows.Win32.Foundation.HRESULT.ThrowOnFailure(IntPtr errorInfo)
   at Windows.Win32.ComHelpers.GetComPointer[T](Object object)
   at Windows.Win32.ComHelpers.GetComScope[T](Object object)
   at System.Windows.Forms.RichTextBox.UpdateOleCallback()
   at System.Windows.Forms.RichTextBox.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

Additional context
This was found by Discord user DraftedDev and discussed in Discord (https://discord.com/channels/500285081265635328/500292370923913222/1286008639303192628)

Apparently the Trimmable option only affects Winforms as SDL worked.

@Doprez Doprez added the bug Something isn't working label Sep 18, 2024
@Kryptos-FR Kryptos-FR changed the title Winforms crash on startup Trimmable - Winforms crash on startup Sep 20, 2024
@Kryptos-FR
Copy link
Member

For context, Winforms is not completely trim compatible. Tracking issue: dotnet/winforms#4649. WPF has the same problem: dotnet/wpf#3811.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants