The exception occurs when publishing .NET 9 application and the "Deployment Mode" in the "Publish profile" is set to "Self-contained".
The exception is not displayed, but instead the application crashes at startup and it seems like it cannot start at all. You can see the error in the Events Viewer tool of the Windows OS, after you navigate to the "Windows Logs-->Application" menu.
This is not reproducible in .NET 8.
The original stacktrace where this was hit is the following:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. File name: 'System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at Telerik.Windows.Input.Touch.TouchManager.InitializeProperties() at Telerik.Windows.Input.Touch.TouchManager.RemoveTapHoldAndReleaseEventHandler(UIElement element, TouchEventHandler handler) at Telerik.Windows.Controls.RadContextMenu.AttachHandler(UIElement element) at Telerik.Windows.Controls.RadContextMenu.CreateReferences(UIElement element)
To work this around, you can try one of the following ideas: