VS 2019 Introduces Remote Debug Support

Debugging on your production machines is now possible with no development tools installed other than the remote debugger tools.

Recently, Microsoft announced remote debug support in Visual Studio 2019 for MSBuild and CMake projects targeting Windows and Linux. 

Debugging on your production machines is now possible with no development tools installed other than the remote debugger tools. Targeting developer environments that you do not use daily is also now possible.

Remote debugging also enables you to target environments where Visual Studio is unavailable for example ARM64 machines, or unsupported operating system versions.

Microsft said that to get a seamless remote debugging experience, you need some additional dependencies to be copied to the target machine. And the company do that for you and automatically deploy these dependencies alongside the built binaries from your project Microsoft deem as needed for debugging.

For example, in the case of Windows Microsoft automatically deploy the Universal CRT library and VCRuntime libraries which are necessary to run and debug binaries in environments where these libraries are not available on the system.

To deploy and debug MSBuild projects targeting a remote Windows machine, in the Property Pages, within the Debugging tab, users will need to specify Remote Command, Working Directory, Remote Server Name and Deployment Directory properties as a minimum. In order to deploy additional files, users will have to specify them in the Additional Files to Deploy property.

Source: Microsoft

VS 2019 enables you to specify both debug and release versions of the runtime libraries. You need to set the Deploy Visual C++ Debug Runtime Libraries and Deploy Visual C++ Runtime Libraries properties to Yes.  After your configuration is set, Studio will take care of deploying all the files to your remote machine,including the ucrt and vcruntime libraries needed. 

If you are targeting Linux using MSBuild project, you need to specify a different machine from your build machine to deploy to and debug on. Only the files necessary for the process to debug will be deployed to the remote debug machine.

Source: Microsoft

If you want more control over your project’s deployment, you can append the code MSBuild elements below to your .vcxproj file. Make sure to specify the actual source and target paths you want.

To learn more you can visit the official announcement here.



Next Recommended Reading VS 2019 For Mac v8.7 Released