Обучение
Пътека за обучение
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
Този браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
If you created a project with an earlier version of the Windows App SDK (previously called Project Reunion) or WinUI 3, then you can update the project to use a more recent release. To learn more about what's currently available in each release channel, see Windows App SDK release channels.
Бележка
These instructions might have issues due to the uniqueness of each app's individual scenario. Please carefully follow them, and if you find an issue then please file a bug against the microsoft-ui-xaml GitHub repo.
If your project isn't referencing the version of the Windows App SDK NuGet package that you need, then you can use the NuGet Package Manager in Visual Studio to update your project's NuGet package references. For example, if you create a new project by using a stable release of the Windows App SDK VSIX, then your project will reference a stable release of the Windows App SDK. But you can easily reconfigure that project to reference, say, an experimental release of the Windows App SDK. Or reconfigure it to reference the latest stable release.
For steps, see the instructions in Use the Windows App SDK in an existing project.
If you created a project using version 0.8 (for example, version 0.8.4), then you can follow these instructions to update your project to the 1.0 release.
Prerequisite: Download and install the latest release of the Windows App SDK. For more information, see Install tools for the Windows App SDK.
In the .wapproj
file, if your TargetPlatformMinVersion is older than 10.0.17763.0
, then change it to 10.0.17763.0
.
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console. This process consists of uninstalling existing Project Reunion package references from .csproj
/.vcxproj
and .wapproj
files, and then installing the WindowsAppSDK
package references to those files.
Enter the following commands to uninstall existing ProjectReunion
packages from your .csproj
/.vcxproj
uninstall-package Microsoft.ProjectReunion -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.Foundation -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.WinUI -ProjectName {yourProject}
Then, run the following to uninstall existing ProjectReunion
packages from your .wapproj
:
uninstall-package Microsoft.ProjectReunion
uninstall-package Microsoft.ProjectReunion.WinUI
Now run the commands to install the stable WindowsAppSDK
package.
To add the WindowsAppSDK
package reference to your .csproj
/.vcxproj
:
install-package Microsoft.WindowsAppSDK -ProjectName {yourProject} -Version 1.0.0
To add the WindowsAppSDK
package reference to your .wapproj
:
install-package Microsoft.WindowsAppSDK -Version 1.0.0
Важно
Version 1.0 Preview 1 and Preview 2 contain a critical bug. If you've already installed one of these previews, see Important issue impacting 1.0 Preview 1 and Preview 2. We recommend using version Version 1.0 Preview 3 (1.0.0-preview3) instead.
If you created a project using version 0.8 Preview or any version of 0.8 (for example, version 0.8.1), you can follow these instructions to update your project to the 1.0 Preview 3 or Experimental release.
Before starting, make sure you have all the Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
First, do the following:
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
Enter the following commands for 1.0 Preview 3:
uninstall-package Microsoft.ProjectReunion -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.Foundation -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.WinUI -ProjectName {yourProject}
install-package Microsoft.WindowsAppSDK -Version 1.0.0-preview3 -ProjectName {yourProjectName}
Or the following commands for 1.0 Experimental:
uninstall-package Microsoft.ProjectReunion -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.Foundation -ProjectName {yourProject}
uninstall-package Microsoft.ProjectReunion.WinUI -ProjectName {yourProject}
install-package Microsoft.WindowsAppSDK -Version 1.0.0-experimental1 -ProjectName {yourProjectName}
Make the following changes in your Application (package).wapproj:
Remove this item group (if you're updating from a different version than 0.8.0, you will see that corresponding version number referenced in this item group):
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.8.0]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.8.0]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Add this item group to replace it with 1.0 Preview 3:
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="[1.0.0-preview3]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Or this item group to replace it with 1.0 Experimental:
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="[1.0.0-experimental1]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="[1.0.0-experimental1]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Make the following changes to your project (.csproj or .vcproj) file:
Remove this item group (if you're updating from a different version than 0.8.0, you will see that corresponding version number referenced in this item group):
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.0" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Add this item group to replace it with 1.0 Preview 3:
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-preview3" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Or this item group to replace it with 1.0 Experimental:
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-experimental1" />
<PackageReference Include="Microsoft.WindowsAppSDK.Foundation" Version="1.0.0-experimental1" />
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="1.0.0-experimental1" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
If your solution fails to build, clean the build output, restart Visual Studio, and try re-running the app.
If you created a project using version 0.8 Preview, you can follow these instructions to update your project to a stable version of 0.8. These instructions also apply if you've created a project with an older stable version of 0.8 (for example, 0.8.0) and want to update your project to a newer stable version (for example, 0.8.2).
Бележка
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 Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
First, do the following:
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
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.8.2 -ProjectName {yourProjectName}
Make the following changes in your Application (package).wapproj:
Remove this item group (if you're updating from a different version than 0.8 Preview, you will see that corresponding version number referenced in this item group):
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.8.0-preview]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.8.0-preview]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Add this item group to replace it:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.8.2]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.8.2]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Make the following changes to your project (.csproj or .vcproj) file:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.0-preview" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.2" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.2" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.2" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
If your solution fails to build, clean the build output, restart Visual Studio, and try re-running the app.
If you created a project using version 0.5 stable, you can follow these instructions to update your project to version 0.8 stable.
Бележка
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 Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
First, do the following:
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
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.8.0 -ProjectName {yourProjectName}
Add the following line to your project (.csproj or .vcproj) file, inside the first <PropertyGroup>
:
<UseWinUI>true</UseWinUI>
Make the following changes in your Application (package).wapproj:
Add this section:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.8.0]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.8.0]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Locate the following line:
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
Move this line and place it on a new line directly beneath the <TargetPlatformVersion>
tag.
Remove this item group (if you're updating from an earlier version than 0.5.7, you will see an earlier version number referenced in this item group):
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.7]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.5.7]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
If your solution fails to build, clean the build output, restart Visual Studio, and try re-running the app.
If you created a project using version 0.5 preview, you can follow these instructions to update your project to use version 0.8 preview.
Бележка
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 Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
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.
The default project templates for both C++ and C# apps included the following lines. The Application.Suspending
event is no longer called for desktop apps, so be sure to remove these lines (and any other uses of this event) if they are still present in your code:
this.Suspending += OnSuspending;
Suspending({ this, &App::OnSuspending });
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
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.8.0-preview -ProjectName {yourProjectName}
Make the following changes in your Application (package).wapproj:
Add this section:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.8.0-preview]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.8.0-preview]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Add the following line to a new line directly beneath the <TargetPlatformVersion>
tag.
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
Remove this line:
<AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
And these lines:
<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]" GeneratePathProperty="true">
<ExcludeAssets>all</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="[0.5.0]" GeneratePathProperty="true">
<ExcludeAssets>all</ExcludeAssets>
</PackageReference>
</ItemGroup>
Make the following changes to your project (.csproj or .vcproj) file:
Remove this item group:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.5.0-prerelease" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.5.0-prerelease" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.5.0-prerelease" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Add this item group:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.0-preview" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
If your solution fails to build, clean the build output, restart Visual Studio, and try re-running the app.
If you created a project using version 0.5 preview, you can follow these instructions to update your project to stable version 0.5.7.
Before starting, make sure you have all the Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
First, do the following:
[Desktop apps only] In the .wapproj file, if your TargetPlatformMinVersion is older than 10.0.17763.0, change it to 10.0.17763.0.
The default project templates for both C++ and C# apps included the following lines. The Application.Suspending
event is no longer called for desktop apps, so be sure to remove these lines (and any other uses of this event) if they are still present in your code:
this.Suspending += OnSuspending;
Suspending({ this, &App::OnSuspending });
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
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.7 -ProjectName {yourProjectName}
If you have a UWP app, your update process should be complete at this stage. If you have a desktop app, make the following changes in your Application (package).wapproj:
Add this section:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.7]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Locate the <TargetPlatformVersion>
tag, and add the following on a new line directly beneath that tag
<AssetTargetFallback>net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
Remove this line:
<AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
And these lines:
<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>
If you created a desktop app using WinUI 3 Preview 4, you can follow these instructions to update your project to Project Reunion 0.5.
Before starting, make sure you have all the Windows App SDK prerequisites installed, including the latest VSIX and NuGet package. For more details, see Install tools for the Windows App SDK.
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.
The default project templates for both C++ and C# apps included the following lines. The Application.Suspending
event is no longer called for desktop apps, so be sure to remove these lines (and any other uses of this event) if they are still present in your code:
this.Suspending += OnSuspending;
Suspending({ this, &App::OnSuspending });
Next, make these changes to your project:
In Visual Studio, go to Tools > Nuget Package Manager > Package Manager Console.
Enter the following commands:
uninstall-package Microsoft.WinUI -ProjectName {yourProject}
install-package Microsoft.ProjectReunion -Version 0.5.7 -ProjectName {yourProjectName}
Make the following changes in your Application (package).wapproj:
Add this section:
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="[0.5.7]">
<IncludeAssets>build</IncludeAssets>
</PackageReference>
</ItemGroup>
Remove the following lines:
<AppxTargetsLocation Condition="'$(AppxTargetsLocation)'==''">$(MSBuildThisFileDirectory)build\</AppxTargetsLocation>
<Import Project="$(AppxTargetsLocation)Microsoft.WinUI.AppX.targets" />
Delete the existing Microsoft.WinUI.AppX.targets
file under the {YourProject}(package)/build/ folder of your project.
Обратна връзка за Windows developer
Windows developer е проект с отворен код. Изберете връзка, за да предоставите обратна връзка:
Обучение
Пътека за обучение
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization