GUI application failing with "Failed to load DLL file, reason code 126"

Document ID : KB000091733
Last Modified Date : 16/04/2018
Show Technical Document Details
Issue:
Generated a GUI application and deployed it to a user workstation. When the user executes the application, the following message is returned. "Failed to load DLL file, reason code 126".
Resolution:
Reason code 126 "Failed to load DLL <module>" means a dependent dll cannot be found. To troubleshoot, it is best to use Dependency Walker to determine the missing dll. 

http://www.dependencywalker.com

Dependency Walker showed that the following DLLs are missing. 

api-ms-win-core-winrt-error-l1-1-0.dll 
api-ms-win-core-winrt-l1-1-0.dll 
api-ms-win-core-winrt-robuffer-l1-1-0.dll 
api-ms-win-core-winrt-string-l1-1-0.dll 

An internet search revealed these DLLs are part of the the Visual Studio 2012 redistributable. 

Installing the VS2012 redistributable resolved the problem. 

VS2012: https://www.microsoft.com/en-us/download/details.aspx?id=30679