C# and .NET Basics

.NET Tooling

Spencer Schneidenbach

Spencer Schneidenbach

Aviron Software, Microsoft MVP
C# and .NET Basics

Check out a free preview of the full C# and .NET Basics course

The ".NET Tooling" Lesson is part of the full, C# and .NET Basics course featured in this preview video. Here's what you'd learn in this lesson:

Spencer provides an overview of the tools used in .NET development such as the .NET CLI, Visual Studio Code, and the C-sharp dev kit extension. He also mentions the NuGet gallery extension for Visual Studio Code and briefly discusses the use of Visual Studio for .NET development.

Preview
Close

Transcript from the ".NET Tooling" Lesson

[00:00:00]
>> Spencer Schneidenbach: All right, let's actually get into looking at some tools. So we're gonna actually stop talking and start doing, which is my favorite thing to do. So the I wanna give a brief overview of kind of all the tools that you will see in.net. So first of all, if you haven't already and want to follow along with the examples, the.net CLI is the Core tool.

[00:00:20]
It's kind of the beginning point for all.net development, as it were. The way you do that is you go to dot.net you go to download, and then I just download the whatever, the L the current LTS version. So one of the things you'll note about .net is that there are.

[00:00:40]
Lots of different ways to install it. I usually just pick this nice, big purple button. I do wanna touch on versions a little bit though, any odd numbered version is considered what we call not it's kind of follows the same pattern as node even numbers are long term support.

[00:00:55]
Which is the only ones that I'll use in a production environment. With some exceptions options. And then these ones, the ones that are in between, the.net 9, the odd numbered versions are really for, well, you see it says standard term support. So let's see a shorter support period of 18 months versus three years for something that's LTS.

[00:01:15]
So in a production environment, I'm always gonna advise that you use and even in a learning environment I would advise that you use the latest LTS version. But this one is for the people who wanna be on the cutting edge and really wanna know about the language features and the framework features that are coming out.

[00:01:29]
And as you can see, it's not even fully released yet. They've got a release candidate out. So it means imminent release but not quite there yet. That's how you download and install .net. Once you do so, you should be able to go to a terminal and say .NET, and you'll see that you get some usage .NET.

[00:01:49]
I'm gonna see dotnet version, --version, and I'm gonna see that I have eight installed. Visual Studio Code is the, so I'm unapologetically an IDE person, for example, I rarely use Git on the command line. I usually use an IDE for it so Visual Studio code is my for this particular purpose.

[00:02:07]
Is actually not my preferred IDE for .net that would I'll touch on that in a second. But Visual Studio code is a very good IDE with a couple of extensions. You're usually you're pretty good to go. So you can download that by Googling VS Code or going to code.visualstudio.com, and it really is just a brand.

[00:02:27]
The Visual Studio part of that is just a brand, but VS Code is as open a product as .NET Code, probably more so in some ways. And then the other thing is the C sharp dev kit extension. So once you have Visual Studio installed, go to the extensions part, and you can see that I already have it installed.

[00:02:49]
I have C sharp dev kit installed. So full disclosure, C sharp the base language support extension, is open and unlicensed. You're free to use it for pretty much whatever. C-Sharp Dev Kit is free for personal use. It does have licensing requirements once you hit certain seat or revenue thresholds.

[00:03:09]
So full disclosure there. But for the purposes of personal use, you don't have to worry about it. And Microsoft doesn't even require you to log in to use the extension or anything like that. It's pretty much just install it and go. So I'd say that this extension is very important because the IntelliSense, which has been a feature of Visual Studio products for a very long time.

[00:03:31]
And it's one of my favorite parts of, one of my favorite early parts of using .NET is the discoverability of API. So IntelliSense debugging, which is really important and we'll demonstrate some of that, and we'll do that all that in VS code. So that's what this extension is used for.

[00:03:46]
So using the .netCLI, let's actually switch back to our terminal, and you're gonnaa see on this page that we have a lot of things that you can use with the .net CLI. So these kind of go through all of the different templates. So somebody asked about using, like having good templates or a good kind of blueprint to start off from.

[00:04:06]
So dotnet new is the command to start a new project. And then it will, the next argument after that is what do you want to build? Do you wanna build a console application? You'll see me do dotnet new console a lot. Do you wanna build a class library which doesn't run on its own?

[00:04:18]
Code that can be referred to by other .net projects or web API for building an example API project. So let's see if you wanna see a list of the templates that are on your screen, you do .net new list. So let's try that new list. I should have a bunch, and I do so you can see that we have all sorts.

[00:04:38]
So lots of decisions to be made, but I will point out as we go the ones that we'll use. Actually, a lot of the code I'll have will be pre-published and you can just open up the solution and go. But you can see that there's ones for react.

[00:04:51]
So this would be React with ASP.NET Core in the backend, which is really useful. But like I said, we'll mostly be doing .NET Console. Dotnet new install so this would be to install additional templates that are community contributed and published to NuGet. Dotnet build and dotnet run you'll see me use those a lot.

[00:05:10]
If I'm not doing them in the IDE I will be doing them in the command line so you'll see that. And then dotnet restore, which, strictly speaking, I don't really use much, dotnet restore is automatically run. It basically just pulls all the packages that your solution needs before it can run.

[00:05:25]
It does that as part of dotnet build and dotnet run, so I rarely run that on my own. And then we have dotnet test, which runs all your unit tests, which we will definitely be getting into that into the next course on ASP.NET Core. We'll be doing a lot of testing there.

[00:05:40]
One other call out for Visual Studio code is that I am, again, unapologetically an IDE, a UI person. So this NuGet gallery extension is something that I found. You can install NuGet packages via the command line. I like the ability to kind of see them inside of my IDE.

[00:05:58]
Can see that if I hit Command P on my Mac and I go focus on NuGet view, you can see that this is where it will show you all of the like the community supported and the Microsoft supported packages that are published by NuGet. And so we'll touch on some of these.

[00:06:14]
But I just wanted to point out that I use an extension for this. I don't usually I try to avoid using the command line because I actually do wanna see things like the version numbers and things like the info, and I find the UI to be more convenient for that.

[00:06:29]
>> Spencer Schneidenbach: Lastly, of course, do we need Visual Studio? I'll say it again we do not need Visual Studio. If you're doing any legacy dotnet development on dotnet framework you could use Visual Studio. It is absolutely a great tool. I still use it I use it with ReSharper which is a JetBrains tool it is a paid product and so as Visual Studio, it's a, it Visual Studio Community, like C Sharp Dev kit is a free to use for personal use, up to five seats and 1 million in revenue.

[00:06:56]
You don't have to pay for it after that they want you to buy their visual studio Subscription. ReSharper is a paid product. You buy it, you license it for, I think for a year, and it adds a whole ton of things to .net, and into Visual Studio to make refactoring easier and navigability easier.

[00:07:16]
I can't recommend ReSharper enough, but if you're on, if you're cross- Platform and doing .NET Core development seriously as a company. JetBrains Rider is the best .NET IDE in the world, sorry, Microsoft, it just is. JetBrains Riders actually used internally by lots of Microsoft people. What is the difference between dotnet SDKs and the runtime?

[00:07:35]
So I believe, okay, so the SDKs, you would install the SDK on your local machine to actually write .NET software. The run times are just what's required to be installed on the target server where you're deploying the application. So if you wanted to run .NET apps, you would install the runtime on Linux, or Windows, or something the target server that you wanna run your application on.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now