Unable to run UAP app without installing vc_redist.64

300 Views Asked by At

I'm using VS 2022, and have a UWP app that references a WinRT project. I'm trying to create a package so I can sideload it onto a separate computer to test that the installer includes everything required.

I've included references to Microsoft.VCLibs and Visual C++ 2015-2019 UWP Desktop Runtime for native apps in the .csproj of the UWP project, and they show up in the "dependencies" folder when the package gets created. However, my app does not work correctly when installed. It works if I install VC_redist.64 manually (separately).

I'm not sure what I've done wrongly? Is there a way to include the VC_redist libraries in a package for sideload?

1

There are 1 best solutions below

9
Chuck Walbourn On

What does the generated .appxmanifest file look like for your UWP? Generally, the installation of the VC++ Runtime is managed by the Microsoft Store based on the appxmanifest.

Note that there is a specific package you can use for installing the runtime the way the Store does offline. See UWPDesktop Downloadable AppX Package.

UPDATE: The root problem here seems to be that the WinRT library is built with the VS 2022 toolset, but the UWP application is using VS 2019. That means the CRT requirement injected into the UWP application is not fully up to date. It is true that VS 2015 Update 3 - VS 2022 offers "forward binary compatibility", but that only works if the distributed binary is the newest one.