 On today's Visual Studio Toolbox, Sayed's going to show us what's new in the just released version of Visual Studio for Mac. Hi, welcome to Visual Studio Toolbox. I'm your host Robert Green and joining me is Sayed Hashimi. Hey, Sayed. Hey, man. Welcome back. Yeah, it's great to be back. You were actually on the show a while ago showing some Visual Studio for Mac tips and tricks, but I wasn't invited. Yeah, right. You know it's my show. That's right. You know, I like to just kind of take over things. Yeah. You know, just do my own thing. So it's awesome to have you to get to be with you. Yeah, right, of course. Yeah, same here, man. Yeah, and we're going to talk about Visual Studio for Mac, a new release, which just became available. Yeah, right, so we had the 8.3 release going out and went out on the same day that Visual Studio 16.3 went out as well. Cool. And, you know, we got a lot of really great kind of new features lined up and I wanted to kind of give a broad overview of some of the new features all across the board but then wanted to kind of dive into some of the more .NET Core slash ASP.NET Core new features that we got and do some kind of demos around that. So let's just take one second to step back. VS for Mac is obviously Visual Studio running on the Mac. So if you have a Mac and you're doing development, yes, you can continue to use parallels and all the things you've done before, VMs and whatnot, but this is Visual Studio running on the Mac. Yeah, that's right. So it's an IDE that's been created using APIs that are native to that platform and there are a lot of components that we share in Visual Studio for Mac with Visual Studio running on Windows. And, you know, I think the biggest difference, I guess, between our good old 20, 30-year-old Visual Studio and Visual Studio for Mac is the kind of the breadth of what's supported, right? You know, in Visual Studio and Windows, you know, there's hundreds of different project types that you can develop on and, you know, a lot of different kind of apps that you can create. In Visual Studio for Mac, we're primarily focused around, you know, three kind of workloads, as we call them. So that would be mobile apps with Xamarin and, you know, there's kind of two flavors of that, Xamarin Forms or native iOS and Android. And then you've got gaming and 3D real-time with Unity. And then the third kind of workload there would be .NET Core and ASP.NET Core and, you know, Azure Functions and stuff like that. And, you know, but one of the, but we don't support, you know, the full breadth of all the different project types, you know, those are the ones that we really kind of focus on and, you know, any technology that has an acronym that starts with the letter W isn't supported on Visual Studio for Mac, right? Like WCF or WPF or Windows Forms, yeah. Yeah, if it starts with a W, it's probably not gonna work in Visual Studio for Mac, yeah. Aka.ms forward slash vsmack docs to learn more and get a link downloaded if you haven't yet. Yeah, that's right. Cool. All right, so that's our little introduction. Now, let's talk about what's new. Okay, so let's talk a little bit about what's new. For the, for mobile development, we have kind of revamped our XAML editor and our previous release, 8.2. We got a brand new XAML editor. The same one that we have in Visual Studio Windows. And we also have Android startup tracing as well and that 8.2 release. And for 8.3, the kind of hot thing for mobile is the XAML hot reload. So that's where you can, that's for Xamarin Forms. So you'll kind of edit your Xamarin Form XAML and we'll automatically show up in the preview there. So that's what we got. And then for gaming and for gaming and 3D real time with Unity, we have much improved Intel Sense for when you're actually writing your code. And there's also some new diagnostics and quick fix tools available for those developers as well. So yeah, so that's it for mobile and gaming and 3D real time. And so yeah, we can focus more on the .NET Core and ASP.NET Core and that's where we'll do some kind of demos here. Sounds good. So yeah, so before we get into the demos, let me tell you about a feature which I'm not prepared to demo here on this particular machine is the updates that we have to NuGet. So we've kind of revamped our NuGet experience in Visual Studio for Mac in this release and one kind of big feature that we've added there is the ability to manage NuGet packages at the solution level. So we've heard a lot of feedback on that one. And so yeah, let's dive into some of the demos here. So the first thing I wanted to share with you, the biggest new feature in my mind is the enhanced editors. So in a previous release, we updated the C-sharp editor to be the same exact C-sharp editor that's available in VS Windows. But with this 8.3 release, we're bringing in the support for the various different web editors. So Razer files, HTML, CSS, JavaScript, so on. So now, so all those files, when you're editing in Visual Studio for Mac, you should get basically the exact same experience that you see in Visual Studio for Windows. Cool. So let me show you an example with a JavaScript file that I have here. So I'm just basically gonna try to re-type in some of the content that I already have here at the very top and we'll just take a look at what the IntelliSense looks like. Okay, so I see I got IntelliSense for Windows, add event listener, oops. So we can see that I'm getting really great IntelliSense here and it's actually the same exact IntelliSense that you would get on VS for Windows. So yeah, this is, I'm not sure if you've tried the, I'm not sure if you've tried out the JavaScript editing experience in Visual Studio for Mac prior to this, but this is a big update here, you know. Let me just do one more here. So yeah, we can see we get all the kind of the, all the same exact editing experience as what you're kind of know and love on Visual Studio itself. And you know, I'm just showing the JavaScript experience here, but for CSS files, HTML, Razer, so on and so forth. This kind of highlights, I think one important thing to understand about Visual Studio for Mac is that it is not a port of Visual Studio for Windows running on the Mac, right? Right. It is a lot of work that came out of the Xamarin Studio editor and then Visual Studio team took over and just tried to straddle the line between it working exactly the same, but also it is a Mac product and it should behave like a Mac product. So you wouldn't necessarily expect to come over and have it be exactly the same thing. Yeah, that's right. If that's what you want, you should probably stick to the parallels and running Visual Studio for Windows route. But it's also, if you're gonna do Mac development, you should be familiar with the Mac, right? Yeah, exactly. So it kind of like pushes you into the deep end of the pool and says, yeah, it's Visual Studio, but look, if you don't know Mac, this has been awfully good time to learn it. Yeah, that's exactly right. You know, when we're creating this product, we're always kind of thinking, you know, the developers are kind of Mac oriented and Mac first developers, right? You know, I think you're kind of, you're thinking from the lens of, hey, I've been developing on Windows and I've always used Windows and now I'm just gonna buy this Mac and try it out. And you know, there definitely are some users in that category, but you know, I think the majority of them are users who already have a Mac and in the past they were either doing parallels or some sort of a remote connection to a Windows machine or maybe they were developing in VS Code or whatever. But yeah, you know, that's one of the kind of big aspects of Visual Studio for Mac is that, you know, it's a native IDE for Mac and we kind of behave, look and feel just like all the other Mac applications do. Yeah, exactly, that's right. Yeah, so that's a big thing for us. But at the same time when I'm typing code, I would kind of expect the same intelligence. Yeah, that's right. So yeah, it is pretty tricky and you know, to be honest with you with this editor effort when we first kind of started it up, I was, man, the plans, when they kind of told me what the plan was, I would be a man, it was really amazing that they're actually able to pull it off. So, this is not my area of specialty, so I don't have all the details of it but essentially what they did was they took the exact same editors that we have in Visual Studio Windows and those editors have dependencies on WPF and make a bunch of WPF calls. So what they did was they took that same exact code and then in the places where it was calling into WPF APIs and classes, they actually just substituted that for Cocoa APIs. So now, you know, whenever they make an update on the Windows side, we can bring it into Visual Studio for Mac. It's just like a drop-in kind of update, basically. And I was really kind of shocked that they're actually able to pull that off. Really pretty amazing, I think. So yeah, having a native API, having a native ID is something that's very important and obviously it has to fit into that ecosystem. So yeah, I'm glad that you brought that up. But yeah, that's right. But once you get into the ID, you know, you should be able to do the same types of things and achieve the same types of goals that you were doing on the Windows side. Yeah, exactly, right? Yep. All right, so that was kind of a brief update for the editors. And I believe we'll have more kind of videos talking about editor specifics as well. So let's go into some other new features that we have. All right, so very quick. Let me let you know that we've also added, and I believe this was in ATA2. We've added the ASPINAC core spa templates and I can create Angular and React projects directly inside Visual Studio for Mac and develop those as you would on Windows. All right, so that was that. And then for 8.3, we've also added support for automatic file nesting. So here I've got index.cshtml and the .cs file is nested under that. And it also works for the web-related files here. We can see in the lib folder, I have bootstrap.css, and then the children are under that. So we've got automatic file nesting. That should kind of help clean up the UI there as you're kind of working on your project there, that's kind of one. Another one that I'm really a big fan of, I think this is kind of a huge productivity boost is being able to select the browser directly in the toolbar. So in the past, in the past, whenever you were to run or debug your ASPIN ad apps, it would just pick the default system browser and a lot of people, they leave that as Safari but then they prefer to debug either and let's say Edge or Chrome. So now you can keep your system browser to whatever it is and then we can change this, let's say from Edge to Chrome and whenever you start without debugging or start debugging, that particular browser would be used. And this is actually slightly different. That's the other kind of thing. Visual Studio for Mac has kind of existed for a while, maybe with different names, so it has a history. And in some places, it's actually more feature rich than Visual Studio Windows. And this is one of those areas, I guess. So on the Visual Studio for Mac side, when you pick a browser, it's actually associated with that project. On the Windows side, it's just kind of a global IDE setting there. So there are little differences there as well. So that was that one. Let's move on to the next one then. We can see that I have multiple projects here and this kind of demo solution that I've created. So one piece of feedback that I had received when I was doing interviews with customers and reaching out and talking with customers was, they asked me and they said, hey, how can I configure more than one project to run when I run our debug? In Visual Studio on Windows, you would right click the solution and say set start a project, right? So this also kind of touches on that previous topic that I said, VS for Mac has its own kind of history and in some cases, it's actually broader set of features than what VS Windows has. This is an example of that as well. So what we've added is the ability, you can right click on your solution and say set startup projects. And then here what it does is it prompts you to create a solution run configuration. So that's a concept that doesn't exist on VS Windows. So a solution run configuration, you can create multiple of them and you can pick which particular projects you want to run and what setting should be applied, but what we've done is, in the past it was much more difficult to configure more than one project. You'd have to right click on the solution, go to options, go to run configuration, create a new one, it was kind of involved, but what we did was we made the entry point essentially the same as Visual Studio on Windows. You right click the solution, you pick set startup projects. So here I'll go ahead and create my solution run configuration. And then at this point, I'm prompted for what projects do I want to run. So I can go ahead and pick these two projects. So these are both web projects. You go ahead and click okay. And then we can see in the toolbar instead of having the name of the project that we had before, now it's got that name of the solution run configuration. And we can still configure the browser under this kind of child item here. Let me switch this one back to Edge. We go ahead and start without debugging and then we'll verify that those two projects were kind of started. In different browsers. Yeah, I configured both of them to go on Edge in this case. Oh, okay, but you could have had them show up under different browsers. Yeah, that's right. Yeah, that's right. So one of them would open up in Chrome and the other one would open up in Edge or however you configure that one. All right, so now we can see that the Edge browser was successfully started and both the websites were kind of brought up and started inside that. Beautiful websites, did you do those yourself? Oh, gorgeous. Yeah, I did these, you know. Look at that. You can't imagine how much time I spent on this, especially from the CSS perspective. I had to reach out to my buddy Mads Christensen for some CSS specific. He wasn't available, is that what happened? Yeah, that's right. All right, so we got that, so let me stop that. All right, so we talked about setting multiple projects on start, so let me show you another kind of feature that I think is really a big time feature here. So now, for ASP.NET Core projects, they have a file that's called launchsettings.json. And that's the file that you can configure how the application should be launched when you either run or debug your project. And inside the launchsettings.json, we can see that we can set the ASP.NET Core environment variable and we can also create whatever other environment variables that we want for our own application. And this is supported not only by the .NET command line, but also by Visual Studio on Windows. And now we have support for this in Visual Studio for Mac. So let me show you how you would edit this. You could either directly edit the file using the editor here in the IDE, where you can right click your project and go into options. And then under run configuration, that's where we can see the items here. So for example, if I was to go through and edit this, say if I change Contoso to example. And I could also change, let's say, the ASP.NET Core environment to production and then click okay. And then we can see now that my launchsettings.json file was successfully updated as well. So that I think is pretty huge. All right, so another feature which we've added recently for .NET Core console projects is the ability to right click and then publish to a folder. So this is brand new and 8.3 as well. So I can show you that. So right click, publish to folder. And then it gives you a default location and that's the same exact default that you would find on Visual Studio. Let me go ahead and publish that one. All right, so now we can see in the status bar that it is publishing to the folder and then when the publish operation completes, we see the finder show up here. So that, and then let me show you what the re-entrant experience for that is. So after you do that for the first time, then you can publish and it would remember that particular folder that you published to and you could also kind of, you could customize the publish process. We have a publish profile here. It's a PubXML file inside the project. So if you need to modify the settings or if you need to extend the publish process, that's how you would do it here. And that's the exact same file that Visual Studio itself uses and so yeah, so that's really great. So that I think is all for kind of like what's new in the 8.3 release, we could. Oh, very helpful. We could talk a little bit about kind of what's coming and for this part of the conversation, I can really only kind of represent ASP.NET Core and .NET Core. We're talking 8.4, 8.x, 9, short term, medium long. So the things I'm gonna talk about are mostly hopefully gonna be in 8.4, but you know obviously there's some chance that you know some of these features could slip into the future releases after that, but some of the work that we're interested in adding support for are for Blazor projects, for the Blazor server side projects. Does that run any differently in Mac than on Windows or is it essentially the same concept? Yeah, so that's a really great question. So there's kind of two aspects to Blazor. One is I can develop a Blazor application and then the other is I can publish a Blazor application. All right, so for the first half, developing the Blazor application. So that's actually very similar to developing other ASP.NET Core apps. Some of the features that we're missing are integration with File New Project. So when I opened up File New Project, you didn't see a Blazor option there, so we're gonna go ahead and add that option. And then the other missing feature there is editor support. So for regular ASP.NET Core apps, the extension for the file is CSHTML. For the Blazor apps, they're .Razor files and there's some additional syntax in there. So we're working on getting the editor support for those Blazor files and then outside of that, most of the features already do work. Like you can build, run and debug Blazor server side projects even before 8.3 in Visual Studio for Mac. And then on the published side, there are some significant enhancements that need to be made. So when you publish to, let's say, Azure App Service, when you use a Blazor server side application, it's highly recommended that you also create a SignalR service in Azure. Because with the Blazor server side, when you have a user connect to it, there's a web socket that's opened and on the Azure App Service, you don't want the same website that's actually serving your web content to also handle all these web sockets. It's not gonna really scale that well, right? So the recommendation is publish your web app to App Service and then also create an associated SignalR service and then the SignalR service will handle all the web sockets and then they can kind of scale independently. So that's what we're working on for publish. And yeah, so that's the kind of publish update. And then beyond that, we're probably gonna look at things like, there'll be some additional kind of publish enhancements, I think that are gonna come out as well. And then after that, some of the kind of top items would be adding authentication to the file new project. So today in VS on Windows, you can say I wanna create a web app and I want individual auth and I want to store the user's in-app and then they also have some cloud options there as well. So we're planning on adding the auth support to new project dialogue. And then after that, the kind of big missing feature in my mind is scaffolding. So we don't have scaffolding support and the IDE today on the Mac side. But you can always run those on the command line today, but it's pretty verbose to type out all the scaffolding commands. So yeah, so I think after we add Blazor, server-side dev and publish support and then add auth to new project and then add scaffolding, then I think all the kind of major kind of rocks are pretty much taken care of. And then from there, we can just try and basically stay in sync with new features coming into VS on Windows. Yeah, that's the kind of overall plan. Cool, so yeah, right, so that's what I got. All right, thanks for coming on and showing us this. Yeah, man, thanks for having me. Always good to be here. So hope you guys enjoyed that. Remember aka.msvsmacdocs to learn more. Go get yourself Visual Studio for Mac, play around with it, let these guys know what you think and we'll see you next time on Visual Studio Toolbox.