 Hello, and welcome to D2 of.NET Conf. Obviously, we could not afford Scott Hanselman for two days. So you got me, and? Hello, everyone. My name is Mika Dumont. I'm super excited to be here. I am Seth Juarez, and we've got tons of exciting things today, a ton of sessions. Mika, can you give us a little taste? Yeah. Let me get out my list here. We have Visual Studio for Mac Reborn as well as some future of Blazor, some F-Sharp, new things in F-Sharp, tips and tricks on moving to.NET Core, and much, much more. Fantastic. So make sure you get your questions in while you're watching. Yes. Because if you ask your questions after we leave, then we can't ask them. So get them all on the board. We want to get all of your questions in. But also, we also have a technical treasure hunt. I'm going to read this because Beth Massie probably wrote this. By the way, you need to follow her on Twitter. She is almost to 10,000 followers on Twitter. And if she gets there, she owes me like 50 bucks. And Mika, she's going to give you like 80. I don't know how to work this out. Yeah, I think we're going to split it maybe. Right. So she gets 80, I get 50. Do you like solving hard technical problems and winning cool prizes? I know you do and I do. Yeah, I definitely do. You're not, you're going to want to watch all of that.NETConf 2019 because.NET Partners are sponsoring a technical treasure hunt. There will be fun challenge to solve and you'll be eligible to win prizes. Just go to.NETConf front slash partay, but spelled party. So what is this session we got coming up right now? Yeah. So right now we have Visual Studio for Mac, reborn new editors and new experiences with Cody Bayer. So Cody, take it away. Hello and good morning, good evening wherever you are today and thank you so much for joining me here. My name is Cody Bayer, Senior Program Manager on the Visual Studio for Mac team here at Microsoft. Today, we're going to be talking about what's new in Visual Studio for Mac from new editors and new experiences and all the other great goodies that we have in Visual Studio 2019 for Mac. So without further ado, let's get started. So 8.3, that's the version of Visual Studio for Mac that we just released yesterday. It is the biggest release of Visual for Mac that we've ever had. It's filled with all bunch of great news features from new web editors, multi-targeting support, of course.NET Core 3 and C-Sharp 8 support, as well as smaller updates like pinning documents and proof quick fixes and source link. By introducing all these new features, we're hoping to really improve the overall developer experience within Visual Studio for Mac. Not just one thing, not just another thing, but the overall end-to-end experience. We have updates in each of those and we'll get to those in a moment. Of course, this is built upon the solid foundation of Visual Studio 2019 for Mac. That includes updates such as the new C-Sharp editor and the new XAML editors, improved Git reliability, updated templates, published your folder, and all sorts of other improvements as well. So not only does 8.3 represents a major step forward in web development and in.NET Core development on VS for Mac, but it's built on top of this great release with new editors, new native editors. We can get right into those because I can't wait to show you all the neat stuff that they include. But first, I want to thank you to our preview users. None of this would have been possible without the folks who hopped onto the preview channel, tried out these new features and gave us feedback. It's invaluable to us and we could not do it without you. So thank you very much for trying out these new features and giving us that feedback to get us to where we are today. All right, so new editor, new backend. Let's talk about what makes up this new editor, why we have a new editor, and what we can do with it. So I had to think of.NET as the most powerful cross-platform toolkit there is. If you look at what.NET does and what we can do with.NET, nothing to me demonstrates this more than the new editor for VS for Mac. So if you think about what a quintessential Windows application is, the Visual Studio Editor on Windows fits that bill. This is WPF, it's been on Windows forever, it's fast, it's stable, and it's also based on.NET. So we looked at what we needed for a new editor in Visual Studio for Mac, we look no further than Visual Studio on Windows. Because it's based on.NET, because it's this cross-platform toolkit beneath it, we were able to port a vast majority of that over to Mac OS. The only portions we didn't take with us was UI layer on Windows, that's WPF, on Mac, that's Cocoa and Cortexed. So we were able to take all the high-level editor features, IntelliSense, all the quick fixes, Roslin, and the language services, all of the little tools that tell what text were to go, all of these things were shared between VS for Mac and VS Windows. That is the power of.NET, and that is how we were able to take the quintessential Windows application and move it to Mac OS. So let's take a look at it and see how it looks in the real world. So I have a cat. This is Buttons right here. He is my cat. I went to my vet and I was told that he needed to go on a little bit of a diet. So I need to start tracking my calories for my cat. This is something that is hard because if you didn't have cats, you know they don't take well to being told how much they can eat. So I want to make an app to remind me of this. I thought what a perfect opportunity to do this, to try out the new web editors to see how I can make an ASP.NET Core app with tracking my cats feeding. So in this application, SuperBasic, I wanted to use ASP.NET Core 3 with the MVC pattern utilizing razor pages. I wanted to mark which days exceeded the K-Cal limits, as well as allow multiple cats because I do have more than one cat, and I don't want to get them confused to feed all one and not feed the other. That would be a disaster. Finally, I want to clearly demarcate by day, so I don't again give all my cats food one week and one day. That'd be terrible as well. So let's take a look at what we did. Hopping on over to VS for Mac, I'm going to launch the Fitty Kitty demo, and I immediately see there's a to-do here. I need to fill in this class. So what am I going to do? Well, first I know that I need a DB context here, because this is the meal context class. So by typing in DDO, shoot, I don't remember the library and the namespace which DB context comes from, and that's rather embarrassing. But with Visual Studio for Mac, I am given a beautiful new tool that helps me figure this out. So we're hopping to preferences and selecting IntelliSense, show import items. I'm able to enable this new feature that lists which import items are available to be imported into my project based on what I'm typing in IntelliSense. So let's see that in action, and hopefully that will make some more sense. By typing in DB context, now I have all of these different completions available to me. You'll see to the right, I have the namespace for which those completions belong. So DB context, which is what I need to import into my project, comes from Microsoft Entity Framework Core. So all I need to do is arrow down to DB context in my editor, hit Tab, and not only does it complete DB context, it also adds the using into my application. This is a huge time saver and really speeds up the amount of time it takes for you to remember all these different imports. I forget them all the time, so it saves me a lot of time, and I hope it saves you a lot of time too. All right now, another great time saver that I've found to be super useful in this IDE is the concept of snippets. So snippets represents any amount of code that you may use many times. So in this case, I need to type in all the methods and mechanisms for the DB context here, and I don't necessarily again remember the exact everything about it. Because I want to impress my friends, I'm going to go ahead and use a snippet that allows me to see and enter the code with just a few characters. So previously, I created a snippet for creating the DB context information. So to do this, I'm going to type in DBCTX. You can see right here that not only is there a snippet here, it has a snippet icon of the ellipses there. As the IntelliSense says, if I tab twice, it's going to insert the DB context snippet. So we'll go ahead and hit tab tab and there we go. Now I have all of the code I need for the DB context method and I can type it in here. So as you can see, there's two sections within this code that say not set. Those are variables that I set within the snippet that allow me to as I'm filling out the snippet type in the code. So let's see. I know this needs to be named meal context. So I type in meal context and you can see not only does it fill in the first variable, but also fills in the second because it both marked with the same placeholder. I'll show you what that looks like in a snippet editor. So you go to preferences, navigate to code snippets. You can see the DBCTX is the first one on the list. That is the one that I created. Now as you can see, I have public, dollar sign, name, dollar sign. That represents a placeholder for user input. You can see that the name is the same name between both of the insertion points. This means that what I type in one, I get in the other. If these were different variables, I'd use different variable names. You can mix these up as much as you want to get the results that you want. Again, I find snippets to be a huge time saver, mostly for code that you have to type a lot, but you don't necessarily remember every aspect of, or for code that has a few plug-and-play parts that you can quickly replace with others. All right. So that's great. I got this part all completed, but I do need to add my DB set. So I'm going to call public DB set. While we're here, I want to point out another fantastic time-saving feature of Visual Studio for Mac that I absolutely love, and that is type filtering. So in this work really well, when you have the show import items feature on that we talked about previously. Now, my completion list is rather lengthy. So if I backspace here, okay, I'm going to start to the D, you can see this is a very full completion list, and it can be somewhat daunting when you don't necessarily remember exactly what you want, but you know it's a class, you know it's a delegate. So with IntelliSense type filtering, you see these icons down at the bottom of your completion window. You can select which ones or which types you want to filter by. So for example, if I want to filter only by classes, I click classes and that limits the completion list to only include classes. Same goes for things such as enums and structures. There we go. By limiting the number of items in my completion list combined with the power of showing all available imports, I have a much more helpful and friendly completion list available to me. So I know that DB set is a class, so I'm going to limit the class, navigate down here to DB set. I know that it is a type of meal, and IntelliSense is going to suggest I call it meals, which I agree with, that's a good name. So I'm going to accept that by hitting tab, then add my get set here. There we go. That essentially completes my context here. Now check out my to-do list and see if there's anything else I need to do once I clear this guy out. There we go. All right. By clicking on tasks, I can see that I need to change kcal from strings to int. So I'm going to double-click here and navigate. I change. Okay. So yeah, it's actually doubles. So I need to change these doubles to integers because that's the data type it needs to be, and whoever did this probably Dominic he did it wrong in the first place. So I'm going to go ahead and change this to be integers. All right. So I can do this in several different ways. I can do a final replace, but that might replace things which I don't want to replace. I can do them one by one, but we don't want to do that anymore. This is the 21st century. We don't need to do things one by one. So what options do I have? Well, I have the power of multi-carat editing. Now, multi-carat editing does, it allows me to have multiple insertion points based on pattern matching. So what I'm going to do here, I'm going to hit Command, sorry, Option, Shift, period, and it's going to select double. Now, if I type that key combination again, we'll see that the next double is selected, and the third time, the third double. Now, if you notice to the right of each of these strings, I have the word or the cursor blinking for double. That means that there's three insertion points in my code right now. So if I type an INT, each of those is changed to integer. So without having to find and replace or doing these each by hand, I'm able to quickly replace those codes in it. Now, this is a very simple usage of multi-carat editing. It is a super powerful feature and it clearly has way more uses than what's demonstrated here. But I hope you give this feature a try. It's available again through keyboard shortcuts and also through your mouse clicks as well. For the keyboard shortcuts, if you check out multi-carats under the Edit menu, you see all the different combinations of keys that you can hit to enable different multi-carat options. All right, so that's step two is done. Now, if we recall, I need to be able to tell when I overped my cat. So let's go into the index.cshtml, take a look at the new web editors. All right, so this is the Fitty Kitty index.cshtml page. Now, I know a few things, surprisingly, but I do know a few things. One of those things is that I need to have a CSS style. But I want to make sure that I'm using proper intelligence here. So, I'm going to, right now, I'm in an HTML document essentially, it's a CSHTML by the code I'm looking at as HTML. So I'm open a tag and I see that I get HTML IntelliSense. That's exactly what I would expect at this point. But I notice this style. I know that the style I want is going to be of type CSS. All right, so now I'm within CSS, I'm within the Style tab. So I need to have a designation for overweight or over calories, apologize, and here I'm going to say background color. See now, I'm getting CSS IntelliSense. So by giving this CSS IntelliSense, I'm able to then complete what I need in this context. So background color, I want that to be red, to warn me that I had a little overfeeding, and I want the text color to be white. So it is readable. I also mentioned that I wanted to have some sort of designation of differences of days. So even days will have a gray background, odd days will have a white background. That way I can clearly demarcate the days. So I need to have another designation here. I'm going to say even day. Again, going to use CSS IntelliSense to get a background color. I'm going to pick light gray. Perfect. All right, there we go. Now I have all the CSS that I need to fill out the styles. So I'm going to hop down into my for each loop and add the code. So we saw HTML IntelliSense, we saw CSS IntelliSense, and now we're going to see sharp IntelliSense all in the same file with context-aware IntelliSense. All right. So how are we going to do this? Well, you can type in C sharp. So I know that I need a string to designate the type of style I'm doing. So style choice. Let me just initialize that that way. All right. So I know the main differentiator is going to be the day. So the first thing I want to mark is whether it's an even or odd day. So if item.time.day is an even number, then style choice is going to equal even day. As that's what I set here. So even day. So you notice that I have set these values to be even to or to be equal to those which I declared it in my style. That way I can use the CSHTML and the C sharp code to designate my style. So I'm going to do the same thing for the over. So if item.kcal limit or day total is greater than 75, 85, let's go with that. Style choice is going to equal over. As again, that is the name of the style that I've put in place within my CSS. So finally, I need to add the class here to my table row designation. So class equals at style choice. All right. That should complete it. Now I should have what I need here to see if I've ever fed my cat, which is important. One thing I want to quickly point out is I can now choose which IDE or sorry, which browser I want the IDE to launch. So in this case, let's go ahead and launch with Microsoft Edge Beta. So I'm going to click deploy, and we're going to watch this work hopefully. The ability to really pick out your web editor is a small but big feature. If you know what I mean, it's not something that's going to change everything, but it makes things a lot simpler. Oops, I have to trust this certificate. Of course I do. I'm a trusting person, and then you type in my password, and I'm going to let you all see it. So I'm a trusting person. All right. Passwords typed in. Bill is successful. Deployment is occurring. Let's see how I did on feeding this week. Locals for 2001. Perfect. Here we go. Now I do have these days designated for when I overfed my cat, I overfed HEMA one day, buttons the other. That's unfortunate, but now at least I know which days I did overfeed my cats on. We did have an issue with even day, and that is because I named it wrong. So if I go back down here and I run it again, even day should now designate the colors as we would expect. Let's make sure that works as expected. There we go. Now the even days are marked as such. So let's take a look back at what features we covered. First, we covered the updated web editors. These include native typing performance with context-aware intelligence. Again, that context-aware intelligence was the ability to have different intelligence languages within the same document based on the context in which I'm writing code. We also saw automatic intelligence importing through show import items. That allows you to import types as you type and ensure that you have anything available to you. One thing to note though, is that if a NuGet package is available in your solution but not within your current code file, it too will be available in the completion list. Intelligence type filtering allows you to limit the amount of data within your completion list based on type. Again, that with combined with the show import items is super useful feature. Finally, we saw multi-carat editing. This allows you to insert multiple carats of code at the same time based on many number of different constraints such as matching characters as well as strings. Finally, one thing I didn't get to show, which is super important, is right to left support in the editor. Now, if you see on the translation here, this is welcome to the editor in Arabic. Arabic being a right to left language, that means the language of the sentences start on the right and end of the left, opposite of what we're used to in English. On the legacy editor, you see that the string was backwards, so it actually read in reverse. That's no good if you're trying to type in the right self-language. Luckily, the new editor supports right to left languages and we can see that the end of the string is where it should be in a right to left language. Again, this is a very important feature if you type in the right self-language or bidirectional languages and we're super happy to have that in our IDE. It was a top community request and we're happy to fulfill it. All right. So quickly, I want to talk about multi-targeting here and then let's see here. So I'm going to open a new instance of the IDE, and multi-targeting is a new feature in Visual Studio for Mac that allows us to target different versions of the .NET Core framework within the same solution. This is super useful when you're trying out new framework types or you want to work on migrating your code. So I'm going to open up this multi-target sample and as it's opening, let's take a look at what this actually means in practice. All right. So here we are, multi-target framework. So you can see up here, I have the ability to choose .NET Core App 3 or .NET Core App 2.2 and also have the ability to target it here. One thing I want to point out in this example is how IntelliSense is aware of your multi-target situation and lets you pick and sorry, demonstrates what versions of completions are available to you. So I'm just going to go on down here, I'm going to type A and as I scroll down, you're going to see that some of these have these little warning triangles next to it. Let's see what that's all about. All right. So if I hover over and select App Domain Setup, we see that it's only available in .NET Core 3. That's not available in .NET Core 2. So now as a developer, I know which target framework I need to pick in order to use the code I need to use this time. Again, another super handy feature that really makes development go a lot faster. Let's hop on back over to PowerPoint here, play from current slide. So again, with multi-targeting, you're able to see that you can target different frameworks with a single app. The framework is aware, sorry, the IntelliSense is aware of the framework which is selected and also aware of what's available in each framework. Super powerful feature and I hope you check it out. We also have an updated XAML Editor in Visual Studio for Mac, which is a huge, huge, huge benefit if you are a XAML developer or if you write in XAML at all. The new XAML Editor includes fuzzy searching, resource intelligence, and type filtering. Now, we don't have enough time to get into this today, but I do suggest checking out both James Montemagno's talk as well as David Orton now is to see how the new XAML Editor works in real-time. I also want to point out that there's more VS for Mac available at .NETConf. Tomorrow at 8 AM, my friend Sayed Hashimi is going to be here to demonstrate how to get started in .NET Core 3 with Visual Studio 2019. Again, I scratch the surface of what's available in .NET Core 3. Sayed's going to deep dive into it and make an app from beginning to end. I really suggest checking it out. It's going to be a great, great, great presentation. All right. So, time for questions. Quickly, my name is again, Cody Byer. You can follow me on Twitter, at seal underscore Byer. We have at Visual Studio for Mac, if you want to follow us on Twitter as a team. Documentation, check it out, aka.ms slash VS Mac docs. Finally, check out Developer Community. We're here to listen to your feedback to provide suggestions, aka.ms slash VS Mac dev call. All right. Let's toss it over for some questions. Wow. That was awesome. Thank you so much, Cody. I love those multi-carat tools that you showed earlier, actually. It was pretty sweet. We have some questions here from Twitter. So, let's see the first one. Over here, S. Ravi Kumar wants to know, I don't see an option to add Docker support and new editor. Any idea when that will be available? I don't off the top of my head, but if you want to hit me up on Twitter, I will get back to you as soon as I can on that. I believe that most of those, the main goal was to get C-Sharp, then XAML, then web, and then these extra Dockerfiles, and YAML, and all those other files, in there as quickly as we can post that point. So, we're looking at the 8.4 timeframe most likely, but if you hit me up on Twitter, I'll get you some more exact timeframes there. Great. Yeah. We have another question on Twitter. Let's see. So, they want to know what's on the roadmap for VS for Mac. Great question. First of all, you can check out our roadmap on the docs page. I don't have the link available and I apologize for that. But we're really focused on bringing Blazor support in 8.4. So, if you've watched any of Daniel Roth's amazing Blazor talks, Visual Studio for Mac is aiming for 8.4 as our Blazor timeframe. So, check out that. Also, update your get back ends to ensure that your get experience is as good as it can be. And again, bringing more of that editor goodness across other aspects of the IDE, including those support files. Awesome. Well, one more question right here. When will .NETConf videos be available on demand? They will be available within 24 hours. So, you can get them right off the presses. Well, I'm pretty excited for the next session. Well, actually we have a little commercial break. Please enjoy this short little package.