Telerik blogs
DotNetT2 Light_1200x303

Our Telerik UI for WinForms and WPF suites provide a .NET Core Project Converter via our Visual Studio Extensions. This tool can convert client projects that use .NET Framework 4.8 (or lower) into .NET Core projects to ease the migration.

Having had .NET Framework for almost 20 years, we, as developers, have produced, and are still producing a considerable number of desktop applications. A new era has come with the birth of .NET Core. Even though some developers may choose to continue using .NET Framework for further development, others tend to dive into the new trends.

The next logical question here is what happens with all existing Telerik WinForms/WPF projects out there that are targeting .NET Framework? Is it possible to convert them to .NET Core?

Our main desktop products, Telerik UI for WinForms and Telerik UI for WPF, always strive to deliver more than expected to the clients. This case with converting an existing project to .NET Core is not an exception.

Since R2 2020 both suites provide tooling in Visual Studio 2019, via the Telerik WinForms and WPF Visual Studio Extensions, that will convert client projects that use .NET Framework 4.8 (or lower) into .NET Core projects to ease out the migration. The menu item is visible only when the solution is loaded in VS2019 and it contains any .NET Framework Telerik projects.

Telerik Visual Studio 2019 Extension

Telerik Visual Studio 2019 Extension - WPF

The .NET Core Project Converter is based on the Try-Convert tool and the .NET Portability Analyzer that Microsoft offers to help .NET developers port their projects to .NET Core.

Please have in mind that even though the conversion may be successful, we don't guarantee that the project will be compiled, or it will work properly, and you may need to fine-tune the output.

The .NET Core Project Converter Wizard allows you to convert Telerik .NET Framework projects to Telerik .NET Core projects. It shows a warning page as a first step to inform users what will and what will not be updated after running the wizard (we don’t want to mislead anyone that we will resolve breaking changes, etc.).

Telerik .NET Core Project Converter Wizard

The Converter wizard lists all detected .NET Framework projects and lists all available .NET Core 3.1 distributions in the dropdown:

Telerik .NET Core Project Converter Wizard - Projects List

On the next page, the wizard builds the projects and runs the .NET Portability Analyzer tool which analyzes the project outputs and generates a report in the solution folder which shows possible issues when converting to .NET Core 3.1. While the build and analysis are running, the wizard shows busy indication and the Visual Studio Output window opens a new .NET Core Project Converter tab which shows the output from the build and analysis process.

Telerik .NET Core Project Converter Wizard - Working

On the next page the user can select whether to create backup of the solution or not and to select location for the backup:

Telerik .NET Core Project Converter Wizard - Backup Creation

After clicking Finish, the wizard replaces the Telerik UI for WinForms / Telerik UI for WPF .NET Framework references with references to the .NET Core assemblies from the selected distribution and runs the try-convert tool which converts the .csproj to .NET Core style project.

Note for Telerik UI for WPF: The RichTextBox assembly is replaced according to the distributions change between the .NET Framework and the .NET Core distributions.

TryConvertWinForms Modification Detection Screen

TryConvertWinForms Converted to .NET Core

Voilà! Now, the project can be run using .NET Core 3.1:

TryConvertWinForms Run Using .NET Core.png

There is a backup folder containing the initial project:

Backup Folder Location

Happy converting!

Telerik Ninja Using a Laptop


About the Author

Desislava Yordanova

Desislava Yordanova is a proactive ambassador of diligent processes and a customer-caring professional. Currently, she is a Technical Support Engineer, Principal in the Document Processing team after a successful journey in the Telerik UI for WinForms team. She joined the company in 2013. Desislava holds a master’s degree in Computer Systems and Technologies from the Technical University in Sofia. Apart from her job, she is keen on snowboarding and travelling. You can find Desislava on LinkedIn.

Related Posts

Comments

Comments are disabled in preview mode.