title: Visual Studio 2015 C++ app requires api-ms-win-crt-runtime-l1-1-0.dll on client clients
body: <p>I've built an application with Visual Studio 2015 Community edition. When some of my users try to run it it they receive the following error:</p>
  
  <blockquote>
    <p>The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.</p>
  </blockquote>
  
  <p>Clearly this is solved by installing the <a href="https://support.microsoft.com/en-us/kb/2999226" rel="nofollow noreferrer">Update for Universal C Runtime in Windows</a> (KB2999226). I could check for the hotfix during the install script but all of the methods I've found to do this are either <a href="https://superuser.com/questions/1002015/why-are-get-hotfix-and-wmic-qfe-list-in-powershell-missing-installed-updates">too slow or unreliable</a>.</p>
  
  <p>How can I prevent this error from occurring? Can I change my solution so that I don't require this dependency? Am I linking against something I can remove? Can I redistribute the hotfix along with my application?</p>
  
  <p><strong>Edit:</strong> In the project properties, the "Target Platform Version" is 8.1 and the "Platform Toolset" is "Visual Studio 2015 (v140)", if that helps at all.</p>
  
  <p><strong>Edit 2:</strong> I've tried copying all of the Universal C Runtime Library DLL's to the application directory since <a href="http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx" rel="nofollow noreferrer">Microsoft now allows (but doesn't recommend) local mode installation of the UCRT</a>. There are 41 files in <code>C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64</code> and <code>api-ms-win-crt-runtime-l1-1-0.dll</code> is one of them. However, now running the application results in this error:</p>
  
  <blockquote>
    <p>The application was unable to start correctly (0xc0000142). Click OK to close the application.</p>
  </blockquote>
  
  <p>I've tried debugging the application with MSVS 2015 but got nowhere. I opened the executable in Dependency Walker and it appears that I'm missing similar DLLs listed in <a href="https://stackoverflow.com/questions/24335787/c-cli-dll-fails-under-win-8-1">this answer, which says that Dependency Walker is old and this is a red herring.</a></p>
  
  <p>I tried running the application through Process Monitor (procmon) and there's nothing unusual. The application simply calls "Process Create" on WerFault.exe and then "Thread Exit."</p>
  
  <p><strong>Edit 3:</strong> I enabled <a href="http://blogs.msdn.com/b/junfeng/archive/2006/11/20/debugging-loadlibrary-failures.aspx" rel="nofollow noreferrer">loader snaps</a> on the executable and got this when running it from cdb, if it helps:</p>
  
  <pre><code>...
  00c0:1200 @ 02106250 - LdrpFindOrMapDependency - RETURN: Status: 0x00000000
  00c0:1200 @ 02106250 - LdrpFindOrMapDependency - ENTER: DLL name: api-ms-win-core-sysinfo-l1-2-1.dll.
  00c0:1200 @ 02106250 - LdrpFindOrMapDependency - INFO: DLL name api-ms-win-core-sysinfo-l1-2-1.dll was redirected to C:\WINDOWS\SYSTEM32\kernelbase.dll by SxS.
  00c0:1200 @ 02106250 - LdrpFindOrMapDll - ENTER: DLL name: C:\WINDOWS\SYSTEM32\kernelbase.dll
  00c0:1200 @ 02106250 - LdrpResolveDllName - ENTER: DLL name: C:\WINDOWS\SYSTEM32\kernelbase.dll
  00c0:1200 @ 02106250 - LdrpResolveDllName - RETURN: Status: 0x00000000
  00c0:1200 @ 02106250 - LdrpFindOrMapDll - RETURN: Status: 0x00000000
  00c0:1200 @ 02106250 - LdrpFindOrMapDependency - RETURN: Status: 0x00000000
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlSetLastWin32Error" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlLeaveCriticalSection" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlEnterCriticalSection" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeCriticalSection" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlDeleteCriticalSection" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlQueryPerformanceCounter" by name
  00c0:1200 @ 02106250 - LdrpGetProcedureAddress - INFO: Locating procedure "LdrResolveDelayLoadedAPI" by name
  00c0:1200 @ 02106250 - LdrpMergeNodes - INFO: Merging a cycle rooted at USER32.dll.
  00c0:1200 @ 02106250 - LdrpMergeNodes - INFO: Adding cyclic module GDI32.dll.
  (c0.1200): Break instruction exception - code 80000003 (first chance)
  *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
  ntdll!LdrInitShimEngineDynamic+0x330:
  00007ffc`d68732e8 cc              int     3
  0:000&gt;
  </code></pre>