Can Visual Studio (NOT VS Code) do remote ssh development? The docs says yes, but

Viewed 6463

This seems like it ought to be solved with a google search, but I've been looking really hard for the past hour and can't find it. There are many links saying Visual Studio (not VS Code) supports remote ssh development (for instance https://docs.microsoft.com/en-us/cpp/linux/connect-to-your-remote-linux-computer?view=vs-2019 ) but none actually show the final step. Can Visual Studio remote develop on linux without installing the code locally?

On VS Code, the feature to remote develop over SSH lets you specify the remote address and then you don't even need the code locally cause all editing and debugging is remote. Does Visual Studio have that feature too? The above link shows how to setup a connection to a machine, but then I can't find any way to actually connect to that machine to browse for the project. How does remote development work in Visual Studio? It seems like I can copy the code locally on my windows box and it will copy the code and build it on linux? But is there not an option like VS Code has where the code lives remotely on the linux box and VS just uses ssh to read it?

2 Answers

I have a VS-Code on Windows and a Cent-Os (linux) like you, and with extensions installed and set up here and there… things work out. But since my company is paying us the Visual Studio 2019_pro edition, I have been trying to make things work. And also, we have our uses and customs with Visual Studio 2019. So, as previously said on the question:

Can Visual Studio remote develop on linux without installing the code locally?"

No ! I agree, it does not work as in VSCode.

But to help others that might come around this question, and IF it is possible for them to clone their repos on Windows, then, I have manage to write my code on Visual Studio 2019, launch the compile (here it does rsync to the linux and launch g++), and then debug. In order to do that, we have to create a new 'Configuration'. This is the things that I think is not properly documented for now. Because, when starting Visual Studio, it creates a default configuration "x64-Debug".

enter image description here

When adding a 'Linux-Debug' configuration (default one proposed by VisualStudio 2019), once setup using the 'connection to a machine', as it has already been stated, in the "Remote machine name" field, then save, and in my case (a CMake file type project), the rsync process is started by VisualStudio and the first 'Configuration' stage of CMake is performed.

Then each time I compile or run, VisualStudio2019 'rsync' the files that I have locally changed from the windows to the linux and compiles/runs.

HTH

Related