'Visual C++ 2022, Microsoft Store and MSIX manifest question

Hi!

Would someone answer my question, please? I have a Visual C++ application linked against C++ DLL Runtime. It is converted to Microsoft Store app by MSIX Packaging Tool. The question is about MSIX manifest: Is this fragment of XML correct for Windows SDK 10.0.19041.0 and VC+ 2022?

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22000.376" />
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.30035.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />

I highly appreciate the support.



Solution 1:[1]

<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22000.376" />

TargetDeviceFamily is telling the AppInstaller runtime that the minimum version that you have tested the app with is 10.0.19041, i.e. May 2020 Update (2004 / 20H1). It's not directly connected to the SDK that you've compiled with (as you could target a much newer SDK, but carefully avoid calling newer APIs unless they're available).

<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.30035.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />

PackageDependency is harder to find information on, as the version numbers don't appear to be listed anywhere (and don't match the Visual Studio 2022 C++ runtime version of 14.31.31103.0). However, I found the following page, which describes "Side-loading of Universal Windows Apps" and lists [Program Files (x86)]\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs.Desktop\14.0\Appx\Retail\. Taking a look around those directories, I can see the following file:

C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs.Desktop\14.0\SDKManifest.xml

The file contains the following:

<FileList TargetPlatform="UAP" 
  FrameworkIdentity-Debug = "Name = Microsoft.VCLibs.140.00.Debug.UWPDesktop, MinVersion = 14.0.30035.0, Publisher = 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US'" 
  FrameworkIdentity-Retail = "Name = Microsoft.VCLibs.140.00.UWPDesktop, MinVersion = 14.0.30035.0, Publisher = 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US'" 
  MinVSVersion = "14.0" 
  TargetPlatformMinVersion="10.0.0.0" 
  TargetPlatformVersion="10.0.0.0" 
  DisplayName = "Visual C++ 2015-2019 UWP Desktop Runtime for native apps" 
  AppliesTo = "WindowsAppContainer + (Managed | Javascript | Native)" 
  AppX-Debug-ARM = ".\AppX\Debug\ARM\Microsoft.VCLibs.ARM.Debug.14.00.Desktop.appx" 
  AppX-Debug-ARM64 = ".\AppX\Debug\ARM64\Microsoft.VCLibs.ARM64.Debug.14.00.Desktop.appx" 
  AppX-Debug-x86 = ".\AppX\Debug\x86\Microsoft.VCLibs.x86.Debug.14.00.Desktop.appx" 
  AppX-Debug-x64 = ".\AppX\Debug\x64\Microsoft.VCLibs.x64.Debug.14.00.Desktop.appx" 
  AppX-Retail-ARM = ".\AppX\Retail\ARM\Microsoft.VCLibs.ARM.14.00.Desktop.appx" 
  AppX-Retail-ARM64 = ".\AppX\Retail\ARM64\Microsoft.VCLibs.ARM64.14.00.Desktop.appx" 
  AppX-Retail-x86 = ".\AppX\Retail\x86\Microsoft.VCLibs.x86.14.00.Desktop.appx" 
  AppX-Retail-x64 = ".\AppX\Retail\x64\Microsoft.VCLibs.x64.14.00.Desktop.appx" 
  SupportsMultipleVersions="Error" 
  SupportedArchitectures="x86;x64;ARM;ARM64"> 
 </FileList> 

As you can see, it mentions 14.0.30035.0. I have Visual Studio 2022 installed (along with Visual Studio 2019) so I'm going to assume that 14.0.30035.0 relates to the most recent version.

Additional: Perhaps not the best assumption, using PowerShell I can see what versions are currently installed:

Get-AppxPackage -Name "*VCLib*" | Select-Object -Property Name, Version, Architecture | Where-Object {$_.Architecture -eq 'X64'}

Name                                     Version      Architecture
----                                     -------      ------------
Microsoft.VCLibs.140.00                  14.0.27810.0          X64
Microsoft.VCLibs.140.00                  14.0.29231.0          X64
Microsoft.VCLibs.140.00.Debug.UWPDesktop 14.0.29231.0          X64
Microsoft.VCLibs.140.00.Debug            14.0.29231.0          X64
Microsoft.VCLibs.140.00                  14.0.30035.0          X64
Microsoft.VCLibs.140.00.UWPDesktop       14.0.30035.0          X64
Microsoft.VCLibs.140.00                  14.0.30704.0          X64
Microsoft.VCLibs.140.00.UWPDesktop       14.0.30704.0          X64

As you can see, the highest version number actually installed on my machine is 14.0.30704.0.

Further: I did some experimentation and found that building an app with Visual Studio 2022, and packaging as an MSIX with a dependency on 14.0.30035.0 will run on a clean installation of Windows 10 2004 (May 2020). So I think 14.0.30035.0 is the correct runtime for Visual Studio 2022.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1