How to use Visual Studio Live Share -Paired Programming and Collaboration

Paired Programming using liveshare

Today in this article, we shall see Visual Studio Live Share features in detail.

Recently I happened to try and use Live Share and was stunned by the power of this tool.

If I ever opt to choose the best feature or tools recently released by Microsoft, then Live Share would be my first choice undoubtedly.

Visual Studio Live Share certainly aims to do away with the traditional practice of sharing the screen via Skype, Slack, or Teams instead of the live interactive code-sharing session.

One can share a file or full project context with continuous collaboration bringing Developers, Testers, and Architects together.

This is one of the tools that can take SDLC to the next level as software industries are leaning towards more lean-agile and T-shaped teams.

As we are now aware the primary goal of Live Share is to enable developers to collaborate easily.

There are below additional use cases that Live Share is capable of addressing.

  • Paired programming
  • Continuous Code Review
  • Interactive Learning/Session
  • Technical Interviews
  • + Many more

Let’s get started and follow the step-by-step process to configure live share for Visual Studio Code.

Prerequisites

  • IDE – Visual Studio Code (1.22 or higher) , VS2017(15.6 and above) or VS2019
  • OS Windows (7,8 or 10) , macOS(10.12) , Linux (Ubuntu 16.04+, Fedora 27+,CenterOS7)

Getting Started – Visual Studio Live Share

Install Visual Studio Code Live Share

  • Install through VS extension within VS Code.

Paired Programming

OR Please install from Market place

  • Once installed successfully Live share icon can be seen in the Status Bar and Activity Bar. Please open the project or files to use it for Live share,

Visual Studio Live Share in Visual studio code

Sharing Project or Files

Please click on Live Share in the Status Bar or Activity as shown above.

Users will be prompted with the below information message showing the default connection mode used will be “Auto”. Please click “OK” to proceed.

Activate Visual Studio Live Share

An invite link will be copied to your clipboard automatically.

Once you start your collaboration session, you can set the session to be read-only to prevent guests from making edits.

By default, it will be read-write mode will be enabled the user will be able to edit the code shared in the session.

Visual Studio Live Share in Visual studio code

Let’s share this link with someone who wants to collaborate. I tried sharing this link to someone who has Visual Studio 2017 or 2019 installed but not VS Code. I found it to be working perfectly fine.

Participants joining the shared link need to click on ‘Join collaboration sessions.

blank

Participants enter the invite link within the command pallet windows below

blank

Once connected all participants will be visible under the session details as below,

Share screen using Live share

Let’s allow 1 more new participant (with VS2019) to collaborate.

Please note that the collaboration between the VSCode and VS2019 works perfectly fine.

Live session with Live share

Participants joining the same meeting invite using VS2019.

blank

Real-time Collaboration in VSCode and VS2019

The below figure shows the real-time Live Share Collaboration in VSCode and VS2019 for the shared codebase.

Visual Studio Live Share in Visual studio code
Live Share collaboration in <strong>VSCode <strong>and <strong>VS2019 <strong>

Stopping the collaboration session

Stopping the sharing session can be done using the below options,

blank

Sharing Terminal windows – Visual Studio Live Share

Apart from sharing projects or files, Live Share allows you to share your terminal window with other users. The shared terminal can be read-only (default) or read/write thereby allowing full collaboration.

blank

Each participant can run commands on the terminal window, see the results, do Builds, run test cases.

blank


Collaborative Debugging – Visual Studio Live Share

Visual Studio Live Share allows a team to follow a collaborative debugging technique to solve any problem/issue. Team members can use this technique for troubleshooting issues by providing a shared debugging session on the host’s machine.

blank

Highlights of Visual Studio Live Share

Here I have listed a few nice-to-know characteristics of Live Share for your information,

  • Visual Studio Live Share is SSH or SSL encrypted and authenticated.

  • Live Share allows a user to share the Terminal window with each other.

  • Users can perform remote debugging by sharing the locally hosted server application.

  • Live Share allows you to share your active debug session, without requiring participants to install any of the necessary platforms SDKs (e.g. Node.js, Go, .NET Core) or tooling extensions.

  • Live Share allows you to share debug state for any programming language or runtime environment (e.g. Kubernetes, React Native app)

  • Live Share allows you to share code between different IDE like VSCode and Visual Studio is possible.

  • Embedded JavaScript in HTML is supported when doing client debugging.

  • JavaScript / TypeScript debugging for Node or browser is supported.

  • Currently, the guest limit is up to 30 users. (Please check for any updates on limits)

  • Users can join in read-only mode to avoid accidental edits.

  • Live Share allows you to control sensitive file access and visibility if required.

References:

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!

Summary

VS Live Share is undoubtedly one of the most recent features from Microsoft. Live share enables developers to collaborate easily and also eases performing extreme programming(XP) practices like paired programming, mob programming, continuous code review, performing Interactive Learnings, conducting brainstorming Sessions, etc…



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *