 Hello, and welcome to Connect. My name is Erica Sweet and I'm a Program Manager on the Visual C++ team. This video will highlight what's new in Visual Studio 2019 for C++ developers. We've worked hard to build a story of cross-platform development and ensure that Visual Studio supports developers who are targeting more than just Windows. In this video, I will continue to build on this story and use our new Start Window Experience to open a cross-platform CMake application that runs on both Linux and Windows, demonstrate our improved Linux targeting experience, and highlight new features that push the boundaries of individual and team productivity. Towards the end of the video, I will invite my co-worker Augustine to join me, as we demo more collaborative features to help make every C++ developer, not just Windows developers, more productive. When you launch Visual Studio 2019, you will be prompted with a new Start Window Experience. To the left, you can still view your recently opened projects and files, and to the right, you have four entry points to view in your code. You can clone or check out code from an online code repository, open a local project or solution file, open a local folder, which supports any folder containing C++ code without generating Visual Studio project and solution files or create a new project. The new project dialog has also been simplified, so you can now filter just for C++ templates, filter by target platform, or by project type. In this demo, I'm going to be running a cross-platform CMake application called Pong that runs on both Linux and Windows. So if I were starting from scratch, I could search for the CMake project template, but I already have saved a copy of the project locally, so I'm going to open it using the open folder experience. Visual Studio has native support for CMake, which means that you can open any folder with a CMake list.txt file without ever generating Visual Studio project and solution files. Visual Studio 2019 also supports a CMake targets view, which is a more CMake-centric way of viewing your file structure organized by targets and allows you to build a single target at a time, run code analysis on one target, or run code analysis on a single file at a time, to name a few options. Up here, you can manage all of your configurations for a cross-platform application. So let's first get this working on Linux. If I navigate to the connection manager using the new search experience, I can manage all of my connections to remote machines. I already have a SSH connection set up to my local Linux VM, but here I could easily add a new one. All you require for a remote build is an SSH connection, a working C++ toolchain on the remote machine, and if you're using CMake, then a relatively recent version of CMake also on the remote machine. To build using CMake on any machine, you need to pass your toolchain file as a CMake command line argument, which we support as a part of our CMakeSettings.json file. I generated this using VC Package, our cross-platform package management system. I did this because Pong has a dependency on the library SFML, which pulls in several other dependencies, and VC Package managed all of this for me. So now that I have set up my remote configuration and set up my remote build, when I hit Run, my application will automatically be launched on my remote machine. So I will hit Run and launch my Linux VM, and when the build is done, I will see Pong. As a part of the C++ development with Linux workload, we also support IntelliSense for headers on remote connections. So here you can see if I hover over, you can see headers being pulled from Linux connections or directly from my Linux machine, which enables IntelliSense exactly as if I were working on my remote machine. So now let's get things set up for Windows. So I'm going to switch over to my Windows configuration and make a few edits to the code. So I'll go down here to the main function and type Sleep. Here I see these purple squiggles, which is actually platform-specific IntelliSense, warning me that what I just typed is undefined for another one of my configurations. So here's specifically Windows.h and the slate function are undefined in my Linux configuration. Visual Studio 2019 also has a new thing called IntelliCode for C++ developers. IntelliCode trains using numerous real-world projects on GitHub that have over 100 stars to give you the best possible suggestions. For this reason, it gives great suggestions for commonly used libraries like STL, which we will take a look at now. So here you can see that Visual Studio is giving me unique suggestions based upon the context of my if statement. Even if I were to continue coding and try to sort my vector, I would be prompted with vbegin and then vend. Now if I were to go back and change this to cbegin, begin, then I would be prompted instead with cend. This shows that my suggestions are changing based upon the context of my code. This is about more than just reducing the number of keystrokes, but it's really about helping developers understand their workflow and understand, oh, this API gets called next, or this API gets called from within the context of an if statement. C++ developers can also now leverage IntelliSense within class and function templates. So you can see here within this template that I'm not getting member list IntelliSense. But if I go up here and I specify that the parameter t should be a player, a type player, then the member list prompts me with relevant suggestions like getName and getScore. If I hover over p, I can also see that p is a player. So now let's run the program on Windows. So it looks good, but actually as I'm playing the game, I realize that my paddle won't go all the way down on the left-hand side. It stops a little bit early, so I'm going to try to figure out what's going on. But actually I'm going to call in a coworker to help me, and we're going to use LiveShare, which is a way for me to instantly share my code base without him having to clone a repo or set up his local environment. So I'm going to start a LiveShare session by clicking the LiveShare and generating a link that I will pass using Skype over to my coworker Augustin, who's going to come help me join this debugging session and diagnose my code. Hi Erica, let's see if I can help. So right now I'm actually on a Linux machine and I'm running Visual Studio Code, but that's not a problem. I went ahead and I opened your LiveShare link, and now I'm taking a look at your code. So it looks like you have this file opened Pong.cpp and it looks like you're currently debugging with the cursor pause here at the beginning of the main function. Now, I actually have full IntelliSense in this code base. Because I'm basically getting the IntelliSense from your machine. So I can actually run operations, like find all references, go to definition, and I don't even have all the tools installed that you have installed on your machine. I'm just getting all this information from your machine in this LiveShare session. And that actually applies to debugging as well. So I can actually go ahead, if I would like, and actually step through a few lines of code. And it's running things through the debugger on your machine. And yet I can still control things from my end. So that's actually pretty cool. But now that I think about it, your problem here is that the paddle doesn't go all the way down to the bottom of the screen. And since this is a graphical application, we can't really just step our way through things in order to fix the problem. So actually let's go ahead and just stop debugging for a second. And I think I remember where roughly the code for controlling that logic is. I'm gonna go ahead and go to line 140. I think that's somewhere near there. And okay, it looks like we have an if statement here, checking if the game is currently going on. And I also see here some logics, some more if statements, checking if the user is pressing the up arrow key or the down arrow key. Now I know that the problem is happening when you try to go to the bottom of the screen, so I'll look under the down arrow key. So let's take a look at things here. It looks like this number is really quite a bit too high. I'm gonna go ahead and lower it to minus five. What this seems to be doing is that it's preventing the paddle from getting anywhere near the edge of the screen. So I think if we make that smaller, it should fix the problem. Why don't we take a look and see if this fixes things? Yeah, it seems to be better. Thanks, Augustine. Glad to help. I hope you have enjoyed this demo. And please connect with us to try Visual Studio, request features, report bugs, or let us know what you think of the product. This aka.ms link links to our C++ blog. And we'll give you more information on everything that I've talked about today. I have also included our Twitter handle for you to reach out to the C++ team directly. Thanks, and please enjoy the rest of Connect.