Support for .NET 8 and .NET 9 ended on 10 November. The next stop is .NET 10, the LTS release supported until November 2028.
Microsoft's breaking-changes list for .NET 10 is long, and most of it is about ASP.NET Core, the SDK and the runtime. If you maintain a WinForms or WPF app, six items matter. Here they are, with the fix for each.
1. New WinForms obsoletion warnings (WFDEV004, WFDEV005, WFDEV006)
Symptom: new build warnings. With TreatWarningsAsErrors, the build fails.
-
WFDEV004:
Form.OnClosing,Form.OnClosedand theClosing/Closedevents. UseOnFormClosing,OnFormClosed,FormClosingandFormClosed. -
WFDEV005:
Clipboard.GetData(string). UseClipboard.TryGetData. -
WFDEV006:
ContextMenu,MainMenu,Menu,DataGrid,StatusBar,ToolBar. They exist only for binary compatibility with .NET Framework. Move toContextMenuStrip,MenuStrip,DataGridView,StatusStripandToolStrip.
Fix: follow the link on each warning. If you can't fix one yet, suppress that ID only (<NoWarn>$(NoWarn);WFDEV006</NoWarn>), not all obsoletion warnings.
2. MenuItem and ContextMenu are now ambiguous in mixed WinForms + WPF projects
Symptom: CS0104 'ContextMenu' is an ambiguous reference between 'System.Windows.Controls.ContextMenu' and 'System.Windows.Forms.ContextMenu'.
From .NET Core 3.1 to .NET 9 these types existed only in WPF. .NET 10 adds them back to WinForms, so a project with both UseWindowsForms and UseWPF (and implicit usings) no longer compiles. Menu, DataGrid, ToolBar and StatusBar have the same problem.
Fix: add an alias for the one you mean:
using ContextMenu = System.Windows.Controls.ContextMenu;
3. WPF: empty ColumnDefinitions and RowDefinitions don't compile
Symptom: error MC3063: Property 'ColumnDefinitions' does not have a value.
A leftover empty <Grid.ColumnDefinitions></Grid.ColumnDefinitions> used to compile. It doesn't any more, because of the new Grid shorthand syntax.
Fix: delete the empty element, or give it at least one <ColumnDefinition /> (or <RowDefinition />).
4. WPF: a wrong DynamicResource type now crashes the app
Symptom: XamlParseException: Set property 'System.Windows.ResourceDictionary.Source' threw an exception. at startup or when a window opens.
Before, using the wrong resource type with DynamicResource (for example a SolidColorBrush where a Color is expected) fell back to the default value and wrote an exception to the output window. Nobody noticed. Now it crashes.
Fix: use the right type:
<Color x:Key="RedColor">#FFFF0000</Color>
<SolidColorBrush x:Key="ResourceName" Color="{DynamicResource RedColor}" />
This one doesn't show up at compile time, so open every window and theme once.
5. System.Drawing throws ExternalException, not OutOfMemoryException
Symptom: a corrupt or unsupported image used to throw OutOfMemoryException, which your code caught. Now GDI+ errors throw ExternalException, and your catch block misses it.
Fix: search for catch (OutOfMemoryException around Image.FromFile, Bitmap and other System.Drawing calls, and catch ExternalException too.
6. TreeView checkboxes are cut off in owner-draw mode
Symptom: with CheckBoxes = true, DrawMode = OwnerDrawText and DrawDefault = true, the checkbox images are cut off on the right.
Fix: it's opt-in. Add this to runtimeconfig.template.json:
{
"configProperties": {
"System.Windows.Forms.TreeView.MoveTreeViewTextLocationOnePixel": true
}
}
Coming from .NET 9, not .NET 8? StatusStrip goes back to RenderMode = System by default in .NET 10, so it can look slightly different. Set RenderMode explicitly if the look matters.
The order to do it in
- Change the target framework to
net10.0-windowsand update your control vendor packages (DevExpress, Telerik, Syncfusion) to versions that support .NET 10. - Fix the compile errors: the CS0104 ambiguities and MC3063 grids.
- Fix or suppress the WFDEV warnings, one ID at a time.
- Fix the runtime changes:
DynamicResourcetypes andOutOfMemoryExceptioncatch blocks. Open every window once. - Test on a clean machine with the .NET 10 Desktop Runtime and update the installer's runtime check.
On an app that already runs on .NET 8, this usually takes a few days, not weeks. Coming from .NET Framework 4.x is a bigger job; see my .NET 8 migration checklist for the extra steps.
Don't want to do this yourself? We migrate WinForms and WPF apps to .NET 10 at a fixed price: WinForms/WPF to .NET 10 migration on Upwork.

Top comments (0)