Windows 10 UWP Desktop Bridge Application (C++): VCLibs dependencies in a debug build

13.6k views Asked by At

I am developing a Windows 10 UWP App with a desktop bridge writen in C++ (Compiled with /ZW). The executable has a dependency to the Visual C++ Runtime.

  • When I add the dependency

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

to the application's manifest in a release build all works fine. I install the application side-loaded. (MinVersion is the version of the VCLibs package copied into the "Dependencies" output folder during the build)

  • When I add the dependency

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

to the application's manifest in a debug build (as documented here: https://blogs.msdn.microsoft.com/vcblog/2016/07/07/using-visual-c-runtime-in-centennial-project/, see "For Debugging"), I cannot install the package with the error "Windows cannot install package ... because this package depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.Debug.UWPDesktop" published by ...".

  • When I skip adding the dependency at all I can install the application, but as expected the desktop bridge process fails to start with the error "vccorlib140.DLL was not found" (or vccorlib140d.DLL in case of a debug build). However, manually installing the Microsoft.VCLibs.140.00.Debug packages from the build output "Dependencies" folder does not change anything.

  • When I add the dependency (without the UWPDesktop suffix)

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

to the application's manifest in a debug build, I can install the application, but it also fails launching with "vccorlib140d.DLL was not found".

How do I get the debug build working? Of course I can copy the VCLibs-DLLs into the system's System32 directory which works but it would be nice if a debug build also works "out of the box".

I am using a 64-Bit Windows 10 Enterprise version 15063.540.

Regards, Dominik

1

There are 1 answers

12
Stefan Wick  MSFT On BEST ANSWER

In order to test the debug version you will need to install the debug VCLIB appx package manually first. More info can be found here:

https://learn.microsoft.com/en-us/troubleshoot/cpp/c-runtime-packages-desktop-bridge