VS Live Share#
Did you ever get frustrated by sharing code with your friends? How nice would it be to do it the Google-Docs style and work on the same document simultaneously! Maybe you know Deepnote, which does this in an online interface. But there’s a better solution: Visual Studio Live Share!
\(\text{Task 1.1:}\) Download Visual Studio Live Share Extension
Download the Visual Studio Live Share Extension from the Visual Studio Marketplace. For Linux, see this website.
\(\text{Task 1.2:}\) Sign in
To collaborate, you’ll need to sign in to Visual Studio Live Share so everyone knows who you are. This sign-in is a security measure and doesn’t add you to marketing activities or other research activities. You can sign in by using a Microsoft personal account (for example, @outlook.com), your TU-Delft account (@student.tudelft.nl), or a GitHub account.
\(\text{Task 1.3:}\) Open a folder
Use your normal workflow to open a folder
\(\text{Task 1.4:}\) Start a collaboration session
Start a collaboration session: select Live Share
on the status bar or select >Ctrl+Shift+P
or Cmd+Shift+P
and then select Live Share: Start collaboration session (Share)
.

The first time you share, your desktop firewall software might prompt you to allow the Live Share agent to open a port. Opening a port is optional. It enables a secured direct mode to improve performance when the person you're working with is on the same network as you. For more information, see changing the connection mode.
An invitation link will be automatically copied to your clipboard. You’ll use this link to interact with yourself in this assignment. If you want to collaborate with other, you can share this link with other to open up the project in their browser on own VS Code.
You’ll also see the Live Share
status bar item change to represent the session state.
\(\text{Task 1.5:}\) Open invitation as second user
Copy the invitation link in your web browser. A web version of Visual Studio Code will open in your browser. Login using the same steps as in task 3.2.
\(\text{Task 1.6:}\) Open invitation as second user
Copy the invitation link in your web browser. A web version of Visual Studio Code will open in your browser. Login using the same steps as before
\(\text{Task 1.7:}\) Edit the notebook from your desktop participant
Go back to your desktop participant of VS code and try typing a few lines of correct code in the cell below. Do you see the same change in the browser happening live?
YOUR CODE HERE
\(\text{Task 1.8:}\) Run code from browser
Go back to your browser version of VS code and try running the cell. Note that this requires Requesting access in the browser participant. Request that access and approve it in the desktop participant of VS code. In the desktop participant you now need to select your python environment. Does the cell run? Do you see the output in both participants? Make sure the output doesn’t show an error to pass this assignment!
\(\text{Task 1.9:}\) Check platform
Let’s try to make sense of what’s happening. Where is the code executed? Run the following code cell from the browser participant. On which computer does this collaborative session run?
import platform
print("Running on a", platform.system(),"machine named:", platform.node())
\(\text{Task 1.10:}\) More functionalities
Explore some of the functionalities of the Live Share (session chat, following). More information can be found here.
\(\text{Task 1.11:}\) Stop collaboration
Stop the collaboration session on the desktop-participant by opening the Live Share view on the Explorer tab or the VS Live Share tab and select the Stop collaboration session button:

Your web-participant will be notified that the session is over. It won't be able to access the content and any temp files will automatically be cleaned up. Don't forget to save your work on the desktop-participant!
\(\text{Tip: A word of caution}\)
Although this tools seems amazing, it doesn’t function always as intended. Especially when editing .iypnb
s like this one with multiple people it might get confused (partly caused by the complex json structure of these notebooks on the background). We advise you to limit editing code and text in these collaboration sessions and to save your work regularly on the host computer
By Tom van Woudenberg and Robert Lanzafame, Delft University of Technology. CC BY 4.0, more info on the Credits page of Workbook.