Update existing projects to the latest release of Project Reunion

If you created a project with an earlier preview or release version of Project Reunion or WinUI 3, you can update the project to use the latest stable release (version 0.5.6).

Note

These instructions may have issues due to the uniqueness of each app's individual scenario. Please carefully follow them and if you find issues, file a bug on our GitHub repo.

Update from Project Reunion 0.5.0 or above

If you created a project using Project Reunion version 0.5.0 or above, you can follow these instructions to update your project to Project Reunion version 0.5.6 (the latest stable release). This version includes several important bug fixes.

Note

If you created a project using the Project Reunion 0.5 VSIX, you may be able to automatically update your project through the Visual Studio Extension Manager, without going through the manual steps below. In Visual Studio 2019, click on Extensions -> Manage Extensions and select Updates from the left menu bar. Select "Project Reunion" from the list and click Update.

Before starting, make sure you have all the Project Reunion 0.5 prerequisites installed, including the latest Project Reunion VSIX and NuGet package. For more details, see the installation instructions.

First, do the following:

  • In the .wapproj file, if your TargetPlatformMinVersion is older than 10.0.17763.0, change it to 10.0.17763.0.

Next, make these changes to your project:

  1. To get all of the changes from the latest stable release, you'll need to explicitly set your .NET SDK to the latest version. To do this, add the following item group to your .csproj file, then save your project:

    <ItemGroup>            
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
    </ItemGroup>
    

    Note that once .NET 5.0.6 is available in May, these lines can be removed.

  2. In Visual Studio, go to Tools -> Nuget Package Manager -> Package Manager Console.

  3. Enter the following commands:

    uninstall-package Microsoft.ProjectReunion -ProjectName {yourProject}
    uninstall-package Microsoft.ProjectReunion.Foundation -ProjectName {yourProject}
    uninstall-package Microsoft.ProjectReunion.WinUI -ProjectName {yourProject}
    install-package Microsoft.ProjectReunion -Version 0.5.6 -ProjectName {yourProjectName}
    
  4. Make the following changes in your Application (package).wapproj:

    1. Add this section:

      <ItemGroup>
          <PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.6]">
              <IncludeAssets>build</IncludeAssets>
          </PackageReference>
      </ItemGroup>
      
    2. Remove the following lines:

      <AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
      

      And:

      <Import Project="$(Microsoft_ProjectReunion_AppXReference_props)" />
      <Import Project="$(Microsoft_WinUI_AppX_targets)" />
      

      And this item group (if you're updating from a newer version than 0.5.0, replace 0.5.0 with your version number):

      <ItemGroup>
          <PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.0]" GeneratePathProperty="true">
            <ExcludeAssets>all</ExcludeAssets>
          </PackageReference>
          <PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.5.0]" GeneratePathProperty="true">
            <ExcludeAssets>all</ExcludeAssets>
          </PackageReference>
      </ItemGroup>
      

Update from Project Reunion 0.5 Preview

If you created a project using Project Reunion 0.5 Preview, you can follow these instructions to update your project to Project Reunion version 0.5.6 (the latest stable release).

Before starting, make sure you have all the Project Reunion 0.5 prerequisites installed, including the latest Project Reunion VSIX and NuGet package. For more details, see the installation instructions.

First, do the following:

  • In the .wapproj file, if your TargetPlatformMinVersion is older than 10.0.17763.0, change it to 10.0.17763.0.

  • If your app uses the Application.Suspending event, be sure to remove or change that line since Application.Suspending is no longer called for desktop apps. See the API reference documentation for more info.

  • The default project templates for both C++ and C# apps included the following lines. Be sure to remove these lines if they are still present in your code:

    this.Suspending += OnSuspending;
    
    Suspending({ this, &App::OnSuspending });
    

Next, make these changes to your project:

  1. To get all of the changes from the latest stable release, you'll need to explicitly set your .NET SDK to the latest version. To do this, add the following item group to your .csproj file, then save your project:

    <ItemGroup>            
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
    </ItemGroup>
    

    Note that once .NET 5.0.6 is available in May, these lines can be removed.

  2. In Visual Studio, go to Tools -> Nuget Package Manager -> Package Manager Console.

  3. Enter the following commands:

    uninstall-package Microsoft.ProjectReunion -ProjectName {yourProject}
    uninstall-package Microsoft.ProjectReunion.Foundation -ProjectName {yourProject}
    uninstall-package Microsoft.ProjectReunion.WinUI -ProjectName {yourProject}
    install-package Microsoft.ProjectReunion -Version 0.5.6 -ProjectName {yourProjectName}
    
  4. Make the following changes in your Application (package).wapproj:

    1. Add this section:

      <ItemGroup>
          <PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.6]">
              <IncludeAssets>build</IncludeAssets>
          </PackageReference>
      </ItemGroup>
      
    2. Remove the following lines:

      <AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
      

      And

      <Import Project="$(Microsoft_ProjectReunion_AppXReference_props)" />
      <Import Project="$(Microsoft_WinUI_AppX_targets)" />
      

      And this item group:

      <ItemGroup>
          <PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.0-prerelease]" GeneratePathProperty="true">
            <ExcludeAssets>all</ExcludeAssets>
          </PackageReference>
          <PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.5.0-prerelease]" GeneratePathProperty="true">
            <ExcludeAssets>all</ExcludeAssets>
          </PackageReference>
      </ItemGroup>
      

Update from WinUI 3 Preview 4

If you created a project using WinUI 3 Preview 4, you can follow these instructions to update your project to Project Reunion version 0.5.6 (the latest stable release).

Before starting, make sure you have all the Project Reunion 0.5 prerequisites installed, including the latest Project Reunion VSIX and NuGet package. For more details, see the installation instructions.

First, do the following:

  • In the .wapproj file, if your TargetPlatformMinVersion is older than 10.0.17763.0, change it to 10.0.17763.0.

  • If your app uses the Application.Suspending event, be sure to remove or change that line since Application.Suspending is no longer called for desktop apps. See the API reference documentation for more info.

  • The default project templates for both C++ and C# apps included the following lines. Be sure to remove these lines if they are still present in your code:

    this.Suspending += OnSuspending;
    
    Suspending({ this, &App::OnSuspending });
    

Next, make these changes to your project:

  1. To get all of the changes from the latest stable release, you'll need to explicitly set your .NET SDK to the latest version. To do this, add the following item group to your .csproj file, then save your project:

    <ItemGroup>            
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
        <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
    </ItemGroup>
    

    Note that once .NET 5.0.6 is available in May, these lines can be removed.

  2. In Visual Studio, go to Tools -> Nuget Package Manager -> Package Manager Console.

  3. Enter the following commands:

    uninstall-package Microsoft.WinUI -ProjectName {yourProject}
    install-package Microsoft.ProjectReunion -Version 0.5.6 -ProjectName {yourProjectName}
    
  4. Make the following changes in your Application (package).wapproj:

    1. Add this section:

      <ItemGroup>
        <PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.6]">
          <IncludeAssets>build</IncludeAssets>
        </PackageReference>
      </ItemGroup>
      
    2. Remove the following lines:

      <AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
      
      <Import Project="$(AppxTargetsLocation)Microsoft.WinUI.AppX.targets" />
      
  5. Delete the existing Microsoft.WinUI.AppX.targets file under the {YourProject}(package)/build/ folder of your project.