Skip to content

Commit ca2b1d9

Browse files
authored
Merge pull request #2249 from dotnet/main
Merge main into live
2 parents 9002d6e + 9854914 commit ca2b1d9

17 files changed

Lines changed: 758 additions & 299 deletions

.github/ISSUE_TEMPLATE/customer-feedback.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ body:
1919
- [Microsoft Q&A](https://docs.microsoft.com/answers/products/)
2020
2121
If your question is related to documentation, please fill out the following information. Select the issue type, and describe the issue in the text box below. Add as much detail as needed to help us resolve the issue.
22+
23+
- type: dropdown
24+
id: technology-type
25+
attributes:
26+
label: .NET or .NET Framework?
27+
options:
28+
- Not Applicable
29+
- .NET
30+
- .NET Framework
31+
- Both
32+
validations:
33+
required: true
34+
2235
- type: dropdown
2336
id: issue-type
2437
attributes:

.github/ISSUE_TEMPLATE/docs-issue.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,8 @@ body:
1616
└─────────────────────────────┘
1717
```
1818
19-
If you're reporting a general product usage question (ex: how do I set the text of a button?), it's better to use Q&A forum like:
20-
21-
- [Stack Overflow](https://stackoverflow.com/)
22-
- [Microsoft Q&A](https://docs.microsoft.com/answers/products/)
23-
24-
If your question is related to documentation, please fill out the following information.
25-
26-
- type: input
27-
id: url
28-
attributes:
29-
label: Article URL
30-
description: "Which article has the problem?"
31-
validations:
32-
required: true
33-
19+
If your question is related to a specific article, **STOP**. Go back to the article page and scroll to the bottom where the GitHub section is. Use the link there to open the issue.
20+
3421
- type: dropdown
3522
id: technology
3623
attributes:

dotnet-desktop-guide/includes/migration-shared.md

Lines changed: 221 additions & 0 deletions
Large diffs are not rendered by default.

dotnet-desktop-guide/winforms/controls/how-to-add-columns-to-the-windows-forms-listview-control-using-the-designer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Add Columns to ListView Control Using the Designer
3-
designer: Learn how to add columns to the Windows Forms ListView control by using the Designer. The ListView control can display multiple columns for each list item.
3+
description: Learn how to add columns to the Windows Forms ListView control by using the Designer. The ListView control can display multiple columns for each list item.
44
ms.date: "03/30/2017"
55
ms.service: dotnet-framework
66
ms.update-cycle: 1825-days

dotnet-desktop-guide/winforms/controls/how-to-create-an-mdi-form-with-menu-merging-and-toolstrip-controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "How to: Create an MDI Form with Menu Merging and ToolStrip Controls"
3+
description: Learn how to create an MDI form with menu merging and ToolStrip controls with the required references to System.Drawing and System.Windows.Forms assemblies.
34
ms.date: "03/30/2017"
45
ms.service: dotnet-framework
56
ms.update-cycle: 1825-days
@@ -12,7 +13,6 @@ helpviewer_keywords:
1213
- "ToolStrip control [Windows Forms]"
1314
- "MenuStrip control [Windows Forms]"
1415
ms.assetid: 64992ed9-44af-4baf-b45f-863e6ab35711
15-
documents: Learn how to create an MDI form with menu merging and ToolStrip controls with the required references to System.Drawing and System.Windows.Forms assemblies.
1616
---
1717
# How to: Create an MDI Form with Menu Merging and ToolStrip Controls
1818

dotnet-desktop-guide/winforms/controls/windows-forms-controls-by-function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Controls by Function
3+
description: Learn about Windows Forms controls and components organized by function, including recommended controls and the controls they superseded.
34
ms.date: "03/30/2017"
45
ms.service: dotnet-framework
56
ms.update-cycle: 1825-days

dotnet-desktop-guide/winforms/dialog-boxes-in-windows-forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Dialog Boxes"
3-
descriptions: Learn about dialog boxes and the various ways that users can interact with them. Also learn how to create custom dialog boxes with Windows Forms Designer.
3+
description: Learn about dialog boxes and the various ways that users can interact with them. Also learn how to create custom dialog boxes with Windows Forms Designer.
44
ms.date: "03/30/2017"
55
ms.service: dotnet-framework
66
ms.update-cycle: 1825-days

dotnet-desktop-guide/winforms/how-to-change-the-borders-of-windows-forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Change form borders
3-
descriptions: Learn how to change form borders when you are determining the appearance and behavior of your Windows Forms.
3+
description: Learn how to change form borders when you are determining the appearance and behavior of your Windows Forms.
44
ms.date: "03/30/2017"
55
ms.service: dotnet-framework
66
ms.update-cycle: 1825-days

dotnet-desktop-guide/winforms/migration/how-to-upgrade-winforms.md

Lines changed: 238 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,33 @@
11
---
2-
title: Upgrade a .NET Framework WinForms app to .NET
3-
description: Learn how to upgrade a .NET Framework (or previous .NET) Windows Forms application to .NET with the .NET Upgrade Assistant and Visual Studio.
4-
ms.date: 04/02/2025
2+
title: Overview of upgrading Windows Forms apps
3+
description: "Learn about the upgrade paths available for Windows Forms apps, including modernizing from .NET Framework to .NET and upgrading between .NET versions."
4+
author: adegeo
5+
ms.author: adegeo
6+
ms.topic: overview
7+
ms.date: 06/24/2026
58
ms.service: dotnet-desktop
69
ms.update-cycle: 365-days
7-
ms.topic: upgrade-and-migration-article #Don't change.
8-
#customer intent: As a developer, I want to use the .NET Upgrade Assistant to automatically upgrade my projects to the latest version of .NET.
9-
---
10-
11-
# Migrate from Windows Forms .NET Framework to .NET
12-
13-
This article describes how to upgrade a Windows Forms desktop app to .NET using .NET Upgrade Assistant. Windows Forms remains a Windows-only framework, even though .NET is a cross-platform technology.
14-
15-
## Prerequisites
16-
17-
- Windows Operating System.
18-
- [Download and extract the demo app used with this article.][winforms-sample]
19-
- [Visual Studio 2022 version 17.12 or later to target .NET 9.](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=learn.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2022+desktopguide+winforms+migration)
20-
- [.NET Upgrade Assistant extension for Visual Studio.](/dotnet/core/porting/upgrade-assistant-install#install-the-visual-studio-extension)
21-
22-
## Assessment
23-
24-
You should analyze your projects before performing an upgrade. Performing code analysis on your projects with .NET Upgrade Assistant generates a report that you can refer to, to identify potential migration blockers.
25-
26-
To analyze your projects and generate a report, right-click on the solution file in **Solution Explorer** and select **Upgrade**. For more information about performing an analysis, see [Analyze projects with .NET Upgrade Assistant](/dotnet/core/porting/upgrade-assistant-how-to-analyze).
27-
28-
## Migrate dependencies
29-
30-
If you're upgrading multiple projects, start with projects that have no dependencies. In the Matching Game sample, the **MatchingGame** project depends on the **MatchingGame.Logic** library, so **MatchingGame.Logic** should be upgraded first.
31-
32-
> [!TIP]
33-
> Be sure to have a backup of your code, such as in source control or a copy.
34-
35-
Use the following steps to upgrade a project in Visual Studio:
36-
37-
01. Right-click on the **MatchingGame.Logic** project in the **Solution Explorer** window and select **Upgrade**:
38-
39-
:::image type="content" source="media/index/vs-upgrade.png" alt-text="A screenshot of the .NET Upgrade Assistant's Upgrade menu item in Visual Studio.":::
40-
41-
A new tab is opened that prompts you to choose which upgrade you want to perform.
42-
43-
01. Select **In-place project upgrade**.
44-
45-
:::image type="content" source="media/index/step-1-inplace.png" alt-text="A screenshot of the .NET Upgrade Assistant tab. The 'In-place project upgrade' option is highlighted.":::
46-
47-
01. Next, select the target framework.
48-
49-
Based on the type of project you're upgrading, you're presented with different options. **.NET Standard 2.0** can be used by both .NET Framework and .NET. This is a good choice if the library doesn't rely on a desktop technology like Windows Forms, which this project does.
50-
51-
Select **.NET 9.0** and then select **Next**.
52-
53-
:::image type="content" source="media/index/step-2-framework.png" alt-text="A screenshot of the .NET Upgrade Assistant. The target framework prompt is open and .NET 8 is highlighted along with the 'Next' button.":::
54-
55-
01. A tree is shown with all of the artifacts related to the project, such as code files and libraries. You can upgrade individual artifacts or the entire project, which is the default. Select **Upgrade selection** to start the upgrade.
56-
57-
:::image type="content" source="media/index/step-3-components.png" alt-text="A screenshot of the .NET Upgrade Assistant. The 'Select Components' page is open with the 'Upgrade selection' button highlighted.":::
10+
ai-usage: ai-assisted
5811

59-
01. When the upgrade is finished, the results are displayed:
12+
#customer intent: As a developer who maintains an existing Windows Forms app, I want to understand my upgrade options so that I can plan and execute an upgrade to .NET.
6013

61-
:::image type="content" source="media/index/step-4-results1.png" alt-text="A screenshot of the .NET Upgrade Assistant's upgrade results tab, showing the migrated items from the project.":::
62-
63-
Artifacts with a solid green circle were upgraded while empty green circles were skipped. Skipped artifacts mean that the upgrade assistant didn't find anything to upgrade.
64-
65-
Now that the app's supporting library is upgraded, upgrade the main app.
66-
67-
### Notes for Visual Basic projects
68-
69-
Currently, the .NET Upgrade Assistant doesn't recognize the use of `System.Configuration` in the settings file created by the Visual Basic templates on .NET Framework. It also doesn't respect the use of the `My` extensions used in .NET Framework projects, such as `My.Computer` and `My.User`. These extensions were removed in .NET. Because of these two problems, a Visual Basic library won't compile after being migrated with .NET Upgrade Assistant.
70-
71-
To fix this problem, the project must target Windows and reference Windows Forms.
72-
73-
01. After the migration is complete, double-click the **MatchingGame.Logic** project in the **Solution Explorer** window.
74-
01. Locate the `<Project>/<PropertyGroup>` element.
75-
01. In the XML editor, change the value of `<TargetFramework>` from `net9.0` to `net9.0-windows`.
76-
01. Add `<UseWindowsForms>true</UseWindowsForms>` to the line after `<TargetFramework>`.
77-
78-
The project settings should look like the following snippet:
79-
80-
```xml
81-
<Project Sdk="Microsoft.NET.Sdk">
82-
<PropertyGroup>
83-
<TargetFramework>net9.0-windows</TargetFramework>
84-
<UseWindowsForms>true</UseWindowsForms>
85-
<OutputType>Library</OutputType>
86-
<MyType>Windows</MyType>
87-
88-
... other settings removed for brevity ...
89-
```
90-
91-
## Migrate the main project
92-
93-
Once all of the supporting libraries are upgraded, the main app project can be upgraded. With the example app, there's only one library project to upgrade, which was upgraded in the previous section.
94-
95-
01. Right-click on the **MatchingGame** project in the **Solution Explorer** window and select **Upgrade**:
96-
01. Select **In-place project upgrade**.
97-
01. Select **.NET 9.0** for the target framework and select **Next**.
98-
01. Leave all of the artifacts selected and select **Upgrade selection**.
99-
100-
After the upgrade is complete, the results are shown. Notice how the Windows Forms project has a warning symbol. Expand that item and more information is shown about that step:
101-
102-
:::image type="content" source="media/index/step-4-results2.png" alt-text="A screenshot of the .NET Upgrade Assistant's upgrade results tab, showing some of the result items have warning symbols.":::
103-
104-
Notice that the project upgrade component mentions that the default font changed. Because the font might affect control layout, you need to check every form and custom control in your project to ensure the UI is arranged correctly.
105-
106-
## Generate a clean build
107-
108-
After your main project is upgraded, clean and compile it.
14+
---
10915

110-
01. Right-click on the **MatchingGame** project in the **Solution Explorer** window and select **Clean**.
111-
01. Right-click on the **MatchingGame** project in the **Solution Explorer** window and select **Build**.
16+
# Overview of upgrading Windows Forms apps
11217

113-
If your application encountered any errors, you can find them in the **Error List** window with a recommendation how to fix them.
18+
This article helps you understand what's involved in upgrading a Windows Forms app from .NET Framework to .NET. Windows Forms is supported on .NET and receives active investment, including newer controls, high-DPI improvements, and accessibility updates. If you maintain an existing Windows Forms app and want to take advantage of those improvements or move to a supported .NET version, this article is for you.
11419

115-
The **Windows Forms Matching Game Sample** project is now upgraded to .NET 9.
20+
The article covers the reasons to upgrade, the available upgrade paths, and the preparation work that makes the upgrade go smoothly. It also explains which .NET Framework technologies have no equivalent in .NET, how to fill API gaps using the Windows Compatibility Pack, and how breaking changes can affect your app.
11621

117-
## Post-upgrade experience
22+
For an example on how to upgrade, see [Upgrade a Windows Forms app to .NET with GitHub Copilot modernization](how-to-upgrade-winforms.md).
11823

119-
If you're porting an app from .NET Framework to .NET, review the [Modernize after upgrading to .NET from .NET Framework](/dotnet/core/porting/modernize) article.
24+
[!INCLUDE [migration-shared](../../includes/migration-shared.md)]
12025

12126
## Related content
12227

123-
- [Porting from .NET Framework to .NET.](/dotnet/core/porting/)
124-
125-
The porting guide provides an overview of what you should consider when porting your code from .NET Framework to .NET. The complexity of your projects dictates how much work you'll do after the initial migration of the project files.
126-
127-
- [Modernize after upgrading to .NET from .NET Framework.](/dotnet/core/porting/modernize)
128-
129-
The world of .NET has changed a lot since .NET Framework. This link provides some information about how to modernize your app after you upgrade.
130-
131-
[winforms-sample]: https://github.com/dotnet/samples/tree/main/windowsforms/matching-game
28+
- [Upgrade a Windows Forms app to .NET with GitHub Copilot](how-to-upgrade-winforms.md)
29+
- [Port from .NET Framework to .NET](/dotnet/core/porting/framework-overview)
30+
- [.NET Framework technologies unavailable on .NET 6+](/dotnet/core/porting/net-framework-tech-unavailable)
31+
- [Prerequisites to port from .NET Framework](/dotnet/core/porting/premigration-needed-changes)
32+
- [.NET breaking changes reference](/dotnet/core/compatibility/breaking-changes)
33+
- [Use the Windows Compatibility Pack to port code](/dotnet/core/porting/windows-compat-pack)

0 commit comments

Comments
 (0)