This article describes how to create a Desktop Bridge container that includes the correct C++ Runtime libraries.
Original product version: Windows 10 Original KB number: 3176696
Summary
Windows desktop applications that have a dependency on the C++ Runtime libraries must specify the corresponding version of the C++ Runtime framework package for Desktop Bridge during creation of the application package. This must be done instead of just redistributing the C++ Runtime libraries that are included with Visual Studio or the Visual C++ Runtime redistributable (VCRedist). Windows desktop applications that run in a Desktop Bridge container cannot use the C++ Runtime libraries that are included with Visual Studio or VCRedist. An application that's running in a Desktop Bridge container and that uses an incorrect version of the C++ runtime libraries might fail when it tries to access resources such as the file system or the registry. This article discusses how to create a Desktop Bridge container that includes the correct C++ Runtime libraries.
How to install and update Desktop framework packages
Microsoft provides C++ Runtime framework packages to allow applications to reference the C++ runtime from desktop applications distributed through the Windows Store. These packages are distributed and updated through the Windows Store and are handled similarly to C++ UWP framework packages.
For development purposes, the current version (v14.0) of both debug and retail appx packages are included with Visual Studio 2022 when you choose the Universal Windows Platform Development workload with the optional C++ (v143) Universal Windows Tools component. The packages can be found under %ProgramFiles(x86)%\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs.Desktop\14.0.
Note
The following package download links are now deprecated, and may no longer work in the future. Make sure to use the method described above to obtain the framework packages.
The C++ Runtime framework packages will be copied to a subfolder under %ProgramFiles(x86)%\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs.Desktop. You can install the packages manually using the Add-AppxPackage PowerShell cmdlet.
How to reference the Desktop framework packages
In your application's AppxManifest.xml file, specify a PackageDependency value that corresponds to the appropriate framework package:
Windows developers have various options for creating applications that run on Windows. This module introduces the native Windows UI frameworks that are available for Windows development. It also provides guidance on how to choose the best framework for your application.