Sharing code and working together on it in real time from different locations has been issue for years. We have video chat and screen sharing for long time but working on same files together in IDE has been a dream. Visual Studio Live Share is here to solve the problem. Although the service is not generally available yet it is possible to try out early versions of it using Visual Studio or Visual Studio Code.This blog post gives straightforward overview of Visual Studio Live Share for developers.
How Visual Studio Live Share works?
The following image shows how shared coding works. One user starts collaboration session and shares link of this session with other developers he or she wants to join. Other developers use this link to join the session. Sharing of sessions is done through Visual Studio cloud so there is no need to open additional ports in corporate firewall.
It is not limited only to two developers – there can be many more people in same collaboration session.
Starting and joining collaboration session
To start a collaboration session we need some project to be opened in Visual Studio. On upper right corner of IDE there is Share button.
Clicking on Share button starts new collaboration session and link to session is automatically copied to clipboard. This is the link to share with other developers who are expected to attend at session.
There are two ways for attendees to join collaboration session. In Visual Studio there is Join Collaboration Session … option in File menu. But it is also possible to paste session link to browser. Edge opens automatically dialog to select application for collaboration session.
When joining collaboration session one should be patient. It sometimes takes about minute for Visual Studio and Visual Studio Code to get shared workspace initialized and running. But still it’s easy to start and join collaboration sessions.
Let’s see now how shared coding works. I had Visual Studio Code opened and joined to collaboration session I started on Visual Studio 2017. I had controller of web application opened in Visual Studio and I started modifying code in Visual Studio Code.
In Visual Studio I saw in real-time how changes done in Visual Studio Code appeared to editor windows. Nice thing is that there is simple tooltip displayed that shows who is editing the code. It’s possible to work on some problematic piece of code with international team where people are located in different places around the globe.
I think there is still room for improvements on visual side of changes to make it easier to understand who is doing what. There are moments when those tooltips are not shown and it is not very easy to get information by moving mouse to special marker. But again – this is not generally available release and I’m sure there is work going on to improve user experience.
Another cool feature of Visual Studio Live Share is shared debugging. For this blog post I opened my TemperatureStation project in Visual Studio and created collaboration session. I added breakpoint to code and ran web application project. I also had Visual Studio Code opened and there I previously joined to same collaboration session.
Things get really interesting when breakpoint is hit in Visual Studio. The icon of Visual Studio Code on Windows taskbar starts blinking and when I switched to Visual Studio Code I saw the same file opened in editor with same breakpoint.
Also notice that output for Visual Studio debug window is shown in Visual Studio Code. But what about local variables when breakpoint is hit? Take a look at the following screenshot.
Besides Visual Studio output we can see on left that we can see the values and structure of variable “sensors”. We can click them open and see what’s inside. You can see on Visual Studio Code toolbar buttons like Continue, Step in etc. meaning that all attendees can take control and continue when some other attendee gives over. Smooth and quick, isn’t it?
Here is the short video by Chris Dias, Dan Fernandez and Amanda Silver about Visual Studi Live Share. They make a good real-time demo how it works in team context.
When it will come available?
I cannot tell any release dates and complete feature lists for Visual Studio Live Share. If you want to stay informed then please follow this blog or Microsoft channels in public and social media. Stay specially alert during yearly events by Microsoft as these are the best moments for Microsoft to make public announcements.
Visual Studio Live Share is coming to ease a lot of pain we have seen when collaborating online in context of writing or debugging source code. Sharing IDE between developers in real-time makes it easy to code and debug together when problems come to our way. Although the final feature list and release dates are not known yet it is still possible to get started as they accept requests for invitations right now. Tooling is currently free and it is available at Visual Studio Marketplace.