Windows Desktop Development and Deployment with Visual C++
Guide to Windows desktop deployment with Visual C++: Redistributable, MSIX, ClickOnce, manifests, DLL deployment, side-by-side assemblies, and C++/WinRT.
Use this file to discover all available pages before exploring further.
Shipping a Windows desktop application built with Visual C++ requires more than just compiling the binary — you must also ensure that all runtime dependencies (the Visual C++ Redistributable, UCRT, and any third-party DLLs) are available on the target machine. Visual Studio provides three deployment strategies: central deployment (installing the Redistributable system-wide), local deployment (placing DLLs alongside your executable), and static linking (embedding the CRT into your binary). Choosing the right strategy impacts security, update agility, and installer size.
Install the Visual C++ Redistributable into Windows\System32. Libraries are shared, Windows Update can patch them automatically. Recommended for most applications.
Local Deployment
Place the required DLLs in the same directory as your .exe. Simple but requires you to update bundled DLLs manually when security patches are released.
Static Linking
Embed CRT code directly into your binary with /MT. No DLL dependency, but the binary is larger and CRT updates require recompilation and redistribution.
The Visual C++ Redistributable package (VC_redist.x64.exe, VC_redist.x86.exe) installs msvcp140.dll, vcruntime140.dll, concrt140.dll, and related files into the Windows system directory. All versions from Visual Studio 2015 through 2026 share the same major version number (14.x), making them binary-compatible. Installing the latest package satisfies all 2015–2026 applications.
# Central deployment: silently install the VC++ RedistributableVC_redist.x64.exe /install /quiet /norestart# Check exit code:# 0 = success# 1638 = newer version already installed (not an error)# 3010 = reboot required
If your installer receives exit code 0x80070666 (“Another version of this product is already installed”), a newer version is already present. This is expected and safe — treat it as success.
MSIX is the modern Windows packaging format for desktop apps. It provides sandboxed installation, automatic updates, clean uninstallation, and support for Microsoft Store distribution.
Visual Studio 2019 and later include the Windows Application Packaging Project (.wapproj) to generate MSIX packages directly from your solution. Right-click your solution → Add → New Project → search “Windows Application Packaging Project”.
Windows Installer (.msi) has been the standard enterprise deployment format for decades. Use the Redistributable merge module (.msm) to bundle the VC++ runtime, or chain the Redistributable setup as a prerequisite.
Redistributable merge modules (.msm) are deprecated — libraries deployed this way cannot be automatically updated by Windows Update. Use chained Redistributable installers instead.
ClickOnce enables one-click installation and automatic updates for desktop applications. It is primarily used in managed (.NET) applications but can be configured for native C++ apps hosted in a managed wrapper.
An application manifest is an XML file (embedded in the binary or placed alongside it as MyApp.exe.manifest) that tells Windows about your application’s requirements: requested execution level, DPI awareness, Common Controls version, and compatibility GUIDs.
When deploying DLLs locally, place them in the same directory as the executable. Windows searches for DLLs in the application directory before looking in System32.
Side-by-side assemblies allow multiple versions of the same DLL to coexist on a machine, each application loading the specific version it was built against. SxS is used by the Visual C++ Redistributable itself.
<!-- MyApp.exe.manifest — references the specific version of MyHelper --><dependency> <dependentAssembly> <assemblyIdentity name="Contoso.MyHelper" version="2.0.0.0" processorArchitecture="amd64" type="win32" /> </dependentAssembly></dependency>
For modern Windows applications targeting Windows 10/11 APIs, use C++/WinRT — a standard C++17 projection of the Windows Runtime. C++/WinRT is header-only and ships with the Windows SDK.
Enable C++/WinRT in your MSVC project by installing the C++/WinRT NuGet package or Visual Studio extension, then set C++ Language Standard to C++17 or later. The /await compiler flag enables coroutine support for co_await.