The C# DevKit is out and gives you a complete .NET experience inside VS Code!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey friends so when you're working with C you can certainly uh you know drive stick shift if you want to I'm going to go out to the command line I'm here in Windows I'm going to go to the GitHub folder and uh make a folder called I don't know random YouTube go into that folder empty say net new console make a console app I think I'm running net uh what do I got here I got Net 7 and I got net uh 8 uh release candidate because net 8's not out yet so I've got that installed and I just went and I did that and I've got program.cs and then I've got this project file okay so that's a net project and then that obj folder this right here that's some binaries and then if I actually say net build you're going to get some more build artifacts this one here is the bin or the binary folder with all the build artifacts in it and if I go into that bin folder you can see I made a debug build and I go into that and see it's a net 8 build and then we have random youtube.exe sitting right there so now I can go and say random Youtube and it says hello world okay and we'll note that we're down there in the bin debug folder okay so I could open that up in notepad we can see here hello world Hello friends maybe I'll put this over [Music] here then I'll say net run Hello friends okay so this isn't like fun right I could sit here and do for loops and uh you know all that kind of stuff but I'm not getting syntax highlighting I'm not getting intellisense it's a whole thing so that's why you use visual studio right so then I could go to visual studio which is Visual Studio in this case Visual Studio for Windows I have the Visual Studio installer and I've got Visual Studio Community I I like to run them side by side you can run multiple versions I'm using the free version that you can get and you've got the community preview and then I've got the released version and I could go and open up for example Visual Studio go ahead and bring that up it's coming up on another monitor and then I'm going to move it over let's go close that we'll say open project or solution I think we called it r random Youtube we'll open that project up I'm going to bring Visual Studio over from the other monitor get the cool nice what's new and then we notice over here in the corner we've got this solution Explorer so here's our program and the solution Explorer isn't a file view okay solution Explorer is interesting because what solution Explorer is doing is it's giving you the ins and outs of the solution ah this is interesting see here it says the current Visual Studio doesn't support net 8 net 8's not out yet so I need to use visual studio uh in this case Visual Studio preview the version for net 8 so I'll go ahead and open that up here comes Visual Studio preview loading loading loading this one's got my Beyonce theme open project random Youtube okay there's our project again I'm doing this side by side which is a little weird let may actually put myself down here okay but I'm pointing out that this solution Explorer is not a file explorer it's representing what's going on inside of the solution and that's cool that's actually useful because within that you can see all the libraries that we're using you can see analyzers that are installed you can see the framework that we're current currently using this is a logical view not a physical view but a logical view so it's better than notepad of course because I can start typing and I say console and then when I hit dot I hit console dot that moment there you start getting intell code which is these ones here in the Stars those are machine learning has decided that it's very likely that I'm going to type right line or read line and then I've got intell sense which is all of the methods and properties that are attached to that uh that object console so background color and things like this and then of course I've got GitHub co-pilot which could then make recommendations and things so you're getting a lot of help you're getting a lot of help when you're inside of an IDE and integrated development environment if we close this up though historically I'm not going to save that historically we uh people who are using visual studio code have had not the full experience you're not getting the full Visual Studio experience you're getting some intell a sense from what's called a language server um and the language server is going to um to interrogate those objects it's going to look at the objects and it's going to say here's some suggestions on what you can do and the language server provides things like everything from the syntax highlighting to the U the interrogation of the objects suggestions on what you're going to do next and there's like a stack of them but the language server knows what's going on now now as of today we've got not just C but the C dev kit this is the new official C extension for visual studio code and this is really cool this is cool because it adds Visual Studio senior Visual Studio for Windows features into Visual Studio code so if you prefer Visual Studio code you can use this if you prefer Visual Studio you can use Visual Studio you see me switching back and forth between them and this will work on Windows Mac Linux or even in codes spaces so you're going to get not just project management which is cool I'll show you in a second you're going to get testing so I can't right click and run tests and then you get Roslin powered Roslin is the C compiler language service for code navigation and things like that so let's go and open our Visual Studio code I'm going to say code and hit dot where dot is the current folder so I'm saying code dot it's going to open up visual studio code here and you can see I've got my random Youtube now this is file based this is the way that you're used to seeing C inside of Visual Studio code I I'm seeing hidden folders I'm seeing that bin and the that OB the one that we saw earlier in the terminal uh and I'm actually seeing the project files in the solution file which you probably wouldn't want to see and you don't see in Visual Studio proper but I'm over here and I've installed the C devkit this is the extension and the C devkit will install other extensions it'll install the c one it'll install the runtime tool and all that kind of stuff and then I can even extend that and install.net Maui for doing crossplatform uh UI but right now I'm going to focus primarily on the C devkit so the C devkit now you can go and install and then I had to sign in just the same way that I sign in when I'm signing into Visual Studio Community or if you pay for visual studio you sign in you get the same thing so if you already have Visual Studio you have this if you use Visual Studio community you sign in with the same account and it lights everything up which is cool now I want to point this out we've got this file section here click away on that you have this this expanding accordion here right I'm going to open up solution Explorer that's new solution explorer was added by this the devkit and now you get look at that look familiar that's the solution explorer that we saw earlier in Visual Studio we have solution Explorer view inside of Visual Studio code which is hot and then because it's Visual Studio code I can do kind of random stuff including adding VSS code pets uh and just have them run around my ID so it's it's Visual Studio code this is an extension for visual studio code except they've taken that language server and that code that makes Visual Studio powerful and brought it over into Visual Studio code which is hot okay so there's our Hello friends hello CP devkit console dot now look see there's those Stars again that's the intell code here's the intell sense it's making the same recommendations and then look that recommendation from co-pilot about what I might want to potentially type next hit tab a couple times very cool all right my little guys are down here running around now I'm going to say run hit F5 and I'm going to say I'm going to run it in C I don't want to debug it in a container I could do it in Docker it's not a Maui application I'm just going to hit F5 and run it in C so builds put a break point here real quick look so now I got my breakpoint got my watch window got my locals here's my breakpoint down here full debug support doing exactly what you would expect except I'm inside of Visual Studio Visual Studio code instead of Visual Studio hover over them get help get all the things that I want to get so now let's go to something more complicated than hello world let's go to actually like my podcast website something that's a little bit more sophisticated okay I'm going to move myself over a little bit more there we go okay so here is uh Visual Studio code with the devkit and on the left hand side here I've got the podcast I have a podcast you should listen to it here is my unit tests my playwright tests and the website itself and you can see the icons indicating that these are tests that's the solution and then that's the website is that cool can open those up you you can see the packages and the relationships if I go over to the testing one you can notice that we have not just packages but also project references again just like Visual Studio I've got the project reference right here and I've got my packages and versions in solution now you notice the solution explorers on the left that's just a visual studio code ISM you can move that around if you want to move that bar off to the right it's totally up to you but then we've also got the test Explorer here so in the test Explorer I've got all my unit testing that I can go and run so I'm in Visual Studio code using the C Dev devkit I'm going to go and run my handome minutes tests look at that so I'm running those tests you can see the timer going right here you can see I can do filtering and all that kind of usual stuff see whether or not those tests pass they did pass ship it right is that great so very very cool stuff going on right now in this space again you just go to extensions you type in C and you're going to want to go and grab the C dev kit that will automatically install the base language support for C works on Linux works on Windows and again as you saw before I can go and open those up in um that same project is openable in Visual Studio it's openable in Visual Studio code so pretty cool stuff happened today uh it's generally available it'll get automatically updated uh so check it out thanks
Info
Channel: Scott Hanselman
Views: 81,657
Rating: undefined out of 5
Keywords: .NET, C#, coding, dotnet, learn to code, programming, visual studio
Id: 6BNtIxW0-xQ
Channel Id: undefined
Length: 13min 4sec (784 seconds)
Published: Fri Oct 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.