Search code examples
c++.netwindowsvisual-studio-2019windows-server

What is needed to run a VS2019-compiled application on Windows Server 2012?


Recently I wrote a program with VS2019, invoking Tesseract OCR dll compiled in C++ (x64) and display result on a .NET Windows form. Everything works fine on my Windows 10 dev PC. When deployed to Windows Server 2012 (x64), it crashed, complaining that the C++ dlls are not found.

What I tried:

  • Install vc_redist.x64.exe from Microsoft, it's still not work. (Maybe not enough?)
  • Run a simple .NET windows form program on that server, and it works well. (It's not a .NET problem)

Update:

I used Dependency Walker that @Fenixil suggested, and the dlls below are not found:

  • API-MS-WIN-CORE-KERNEL-32-PRIVATE-L1-1-1.DLL
  • API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
  • API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
  • MF.DLL
  • MFPLAT.DLL
  • MFREADWRITE.DLL
  • API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
  • EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
  • IESHIMS.DLL
  • SETTINGSYNCPOLICY.DLL
  • WLANAPI.DLL

Those dlls can be found in my dev PC, in C:/Windows/WinSxS, multiple files in same name under different directory. Do they belong to some Windows SP update, or are they in the Win10 platform API? What's the best way to install them instead of simply copying them to production server?


Solution

  • There are multiple versions of vc_redist, you need to provide one that is used in your application. Here is some discussion with vc_redist not found, might be related to your issue.

    You can use Dependency Walker tool to check which dlls are missing in the system