Skip to main content

Migrate WPF Applications to .NET

  • 3 minutes to read

This topic describes how to upgrade a WPF application that uses DevExpress controls to .NET.

Important

Make sure you back up your projects prior to upgrading if you are not using source control.

Prerequisites

To convert your DevExpress-powered .NET Framework application to the latest .NET version, do the following:

Convert DevExpress Assemblies to NuGet Packages

Use the DevExpress Project Converter tool to quickly replace DevExpress assemblies (dll) with corresponding DevExpress NuGet packages as follows:

  1. Run the DevExpress Project Converter.

    In Visual Studio, navigate to ExtensionsDevExpressProject ConverterProject Converter v24.2.

  2. Click Advanced to expand additional settings and enable “Convert DevExpress assembly references to NuGet packages”.

    DevExpress Project Converter

  3. Once you click the “Convert DevExpress assembly references to NuGet packages” option, the warning message below automatically pops up:

    Convert DevExpress DLLs to NuGet Packages

    Click OK to proceed.

  4. Click Upgrade All to convert all assemblies in your solution. To convert assemblies in specific projects only, click Search and Select Projects.

Note

If your project references satellite assemblies (localization resources) for cultures other than DE, ES, or JA, they will not be automatically converted to NuGet packages, as these resources are not available at nuget.devexpress.com.

Upgrade Your App to the Latest .NET Version

Follow the steps below to upgrade your .NET Framework application to the latest .NET version:

  1. Install the .NET Upgrade Assistant.

  2. Right-click a project in the Solution Explorer window and select Upgrade:

    Upgrade a WPF Project to .NET - Click Upgrade in the Solution Explorer

  3. Select one of the following options based on your preferences:

    • In-place project upgrade: Upgrades your project without making a copy.
    • Side-by-side project upgrade: Copies your project and upgrades the copy.

    Convert to .NET - In-place upgrade

  4. Select the target framework and proceed:

    Select a target framework

  5. On the next page, select components to upgrade and click Upgrade selection.

    Upgrade selection

Consider Portability Limitations

.NET is missing some APIs that are present in the .NET Framework. Use the .NET Portability Analyzer tool to determine whether your application uses such APIs.

Try to refactor your code to reduce the number of calls to missing APIs. Look for an alternative API with the required functionality.

Useful resource: .NET Framework technologies unavailable on .NET.

Update Non-DevExpress NuGet Packages

DevExpress NuGet packages are compatible with both .NET and .NET Framework platforms.

Check whether the non-DevExpress NuGet packages used within your project are compatible with .NET and whether newer compatible versions are available.

Update your project to reference the latest package versions, if necessary.

Tip

Perform this step even if Visual Studio does not show any compile-time errors. You may experience runtime exceptions if you build the application with packages that were not tested against the .NET Runtime.

Fix Build Issues

If Visual Studio shows build errors, follow the output to refactor your code until you can successfully compile it.

Tip

Known Limitations

  1. Visual Basic projects display the following warning after conversion:

    .vbproj uses code generators which will not be handled by try-convert. You can edit your vbproj to add support or remove these dependencies.

  2. The default .NET platform is AnyCPU. If your .NET Framework solution has only the x86 platform configured, manually specify the platform in the project file:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <Platforms>x86;AnyCPU</Platforms>
        ...
      </PropertyGroup>
      ...
    </Project>
    

Test Your App

Run and test the upgraded app. Remember that runtime exceptions are possible even if the application was built without compile-time errors.

Useful Resources

The following Microsoft topic gives an overview of useful techniques and automated tools to port your code to .NET: Port your code from .NET Framework to .NET.