Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Remote Debugging - MSVCP140.dll is missing

I am trying to debug a .Net application running on remote machine from my local dev. machine. I am getting an error saying MSVCP140.dll is missing

Details:

Dev. machine: Visual Studio 2015, Windows 7

Remote machine: Windows Server 2012 R2, Visual Studio Remote Tools for 2015 installed.

On remote machine, I configured the Remote Debugger with "no authentication" and port 4020.

In dev. machine's Visual Studio Attach to Process window, configured as below:

Transport: Remote (no authentication)

Qualifier: remote_machine_name:4020

As I click on Refresh button, it lists remote machine's processes. While on remote machine, the Visual Studio Remote Debugger window shows that user_name connected.

Screenshot of Remote Debugger window

As soon as I attach to the remote machine's process in Visual Studio, it enters into the debug mode, but symbols remain unloaded.

Interestingly, on the remote machine I got an error message: "The program can't start because MSVCP140.dll is missing from your computer.
Try reinstalling the program to fix this problem."

Screenshot of error: MSVCP140.dll is missing

Though, the file MSVCP140.dll exists in the path of msvmon.exe file.

like image 858
Nagesh Andani Avatar asked Jul 06 '17 09:07

Nagesh Andani


People also ask

How to fix code execution cannot proceed because MSVCP140 dll?

Solution 1: Reinstall the App Step 1: Click on Start and select Settings. Step 2: Select Apps from the menu tiles. Step 3: Click on the app causing the error and select Uninstall. Step 4: Restart your computer, then reinstall the app by downloading it from the vendor's website or Microsoft store.

What is MSVCP140 dll mean?

MSVCP140. dll is also called as Microsoft® C Runtime Library, which belongs to Microsoft Visual C++ Redistributable Packages for Visual Studio® 2015. Therefore, although MSVCP140. dll is not an essential system file of the Windows operating system, it is required for running programs developed with Visual C++.

How do I create a .pdb file in Visual Studio?

In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.

How do I use PDB files for debugging?

To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally, and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().


1 Answers

I was able to get the Visual Studio 2015 Remote Debugger to work by adding the directory where msvcp140.dll resides on the remote host to the remote host environmental variable "path" variable and restarting the remote debugger on the remote host.

  1. Locate msvcp140.dll on the remote host. For me, there were several copies, and I chose "C:\Program Files\Microsoft Visual Studio 14.0\Remote Tools\DiagnosticsHub\".
  2. Open the Environmental Variables dialog. Control Panel -> System and Security -> System -> Advanced system settings -> Environmental Variables...
  3. In the "System variables" group, select "path" and click Edit...
  4. Add a semicolon to the end and paste the path to msvcp140.dll (C:\Program Files\Microsoft Visual Studio 14.0\Remote Tools\DiagnosticsHub) after the semicolon.
  5. Click OK, click OK, click OK.
  6. If the Visual Studio Remote Debugger is running (check the system tray icons), exit it, then start the Visual Studio Remote Debugger.
like image 69
Greg Mulvihill Avatar answered Oct 26 '22 23:10

Greg Mulvihill