In this video we're going to be touring visuals to do would be creating a simple console application
for C sharp and we'll be looking at the interface and just getting familiar with all of the buttons
and what all of them do know my visual studio is using what we call dark mode which makes it black.
So your own is probably silver or white in the interface and I will show you how to change that but
for know this screen launches whenever you click Visual Studio and to the left you see a list of all
of your recent projects.
I've had a number of projects working on I kind of collapse them so as not to put too much on the screen
for display at this point but your own will probably be empty but you will have the option so the right
asking you to clone our check code open up project folder or create a new project something to click
Create a new project this launches the different categories of projects that are available to you.
So based on the package that you would have installed you may see more or fewer than I have on my screen.
I have quite a few packages installed on my visual studio instance so I have more options but for the
purpose of this lesson we want to create a C sharp console application so we can actually just search
instead of trying to scroll through and look and try and figure out which one it is.
We can search or we can narrow it down by selecting the actual language that we want the environment
that we want to develop something for it.
In this case windows and the whether it's desktop or mobile so once again based on the packages that
you would have installed then you can get that filter.
So I chose C sharp windows console and then I have two options I have a dot net core console app and
I have a dot net framework console app no no.
The difference between the two a dot net core console.
It creates a project that allows you to create a console application that can run on Windows Linux and
Mac OS over the traditional one open to core but it was just the regular button and framework which
created a project that can run on Windows.
So I'm just going to continue with the traditional Dot Net framework application for No.
And then we can create a dot net core one later and compare.
So when to proceed with the Dutton framework click next and then we give it 10 names some someone to
call this test net console all right.
So in the project name you want to avoid special characters as much as possible.
And also you probably want to chemical case to make sure that it's readable.
It is very case sensitive so if your chemical case or you have a mixed case word then rest assure that
it will play a very big part in referencing anything inside that project going forward.
This might be your default location based on your username or your full set up on your computer.
However you can always go to browse and change where you want your projects to go.
Next we have the solution name and I'll show you what the project name different from the solution named
what we can actually choose a different solution name as the project goes in sight of a solution and
a solution can have multiple projects.
So these two don't necessarily always have the same name.
All right.
And then we can select the version of Dutton for more that we want so you can see that details backwards
composer booths open to button it from work 2.0 or like I said each framework has you know the latest
one has more recent libraries and support for libraries.
But then what works in the latest one may not work on an old computer.
And then what was done on the older versions might not be very compatible with say Windows 7 and Windows
10.
So you know choose your bottle carefully you know what your environment is.
But I have a Windows 10 computer and I like to be on the cutting edge of things so I leave mine at Dalton
and framework four point seven point two.
And then I can just take a cursory glance make sure everything is good and then click Create
once all of the preparations are done visit a studio with the launch and then we'll see code file followed
by you know this wonderful interface and some other thing.
So the first thing I'm going to do however is show you how to change the DART mode if you're not already
in Dart mode and are interested so you can go to Tools then select options and then the very very first
option in this dialog box is allowing you to choose your color theme.
So you're probably on a light or blue.
You have blue contrast and you have dark so you can to select dark click Okay.
And then you will get this wonderful looking contrasted interface.
No.
Another thing you may note is that your solution Explorer is to your right.
Mine is to my left I rearrange it that way because I find it easier to just move to the left to find
the file.
Sometimes I'm typing code here and then I have to move all the way to the right.
I mean it's it's really a matter of layout and flexibility and how you prefer it.
No visual studio allows you to put it the way you prefer it so you can actually drag any pain called
MP and seek and drug drag any pain and then you can dockets where you once you see these little squares
are tangles if you drag them into the space then it will kind of put you right in that section that
is designated right or I can just leave it right there floating Well it's more of a humbug here in the
middle of the screen than anything so I like my end to the left.
So you can do that if you wish if you want more real estate sometimes you're writing code and Europeans
are to the side you know open like this enter take him to what space you may not have a big screen and
you want more space to do certain things you can always just unfinished so you see this pin is seeing
auto hides I can make it auto hide how and when I need it I just click it and it comes out I do what
I'm doing and then it goes back you'll also see that I have other pins that you know you may not have.
So as the need arises and you feel that you need a pin you can just go to view and then you find the
pain that you want.
So for instance I have one here does is sequel server object explorer and that's like a mini database
management system inside Vizio studio for this do to or you won't need that but then for other projects
I work on I use it so when I expand it I see things in there but then I'm not going to be using them
for this for this sets of lessons.
No this code file that I had alluded to before this is our main code file for our console.
So if I want to increase the font size I can just hold on on the control button and scroll in and you
see I can screw it up or don't increase or decrease the size of the fund.
So I'm just going to increase its a bit so that we can all see exactly what's happening on my screen
in the solution.
Explorer you'll see that the file name matches the class name.
All right so I'm not going to teach you code in this particular list I'm just trying to point out some
visual cues to make sure that when you see them you know exactly what they mean.
Right.
So we have the program not see us and see sharp files are stored as dot see us the class files get the
extension that see us but then you see that you have other files with different extensions like dot
config and as you put more and more in your project then you're going to see different file extensions
for different purposes and being a bit more attention to the solution explorer you'll notice that you
have this expunged mind a bit you have the solution and then you have and it does have a name so it
says solution testing a console but then under that you see that it has another like a child right.
You see that indentation that suggests that this is a child of the solution.
So this is a project which then has the project files.
So I was saying earlier that the solution doesn't necessarily have to have the same name as a project.
As a matter of fact within the solution I can actually click and remove a project if I want or I can
add other projects so if I wanted to console apps but I wanted them on the same solution.
So when I open the solution which is my overall collection of projects then I would see every single
projects I could have one to say hello world one to do math one to do other operations.
And that's exactly how we're going to be building out our applications.
I'm going to be using one solution and then we're just going to add a project her code example that
we will be doing now at the top and I'm talking about this section that is underneath our toolbar and
you see the little icon so you know you have that safe icon you have save all that's save all the files.
So if you have multiple files open and editing I just want to make one massive save you just do save
all but then you notice that the Google Keyboard markets along the way so you know it's easier to just
do control.
That's why they are writing code then to stop moving on from the keyboard and go all the way up here
just to save or to save all.
So along the way I'm going to be showing you a little keyboard shortcuts so that you can make your coding
experience more efficient as you continue from the Save button.
You'll see that you have some configuration settings they have Deeble year ever release you have any
seat use their low to kind of determine okay what settings should I simulate when I am about to start
my program.
So you see that button with the green arrow and it says start you can just click that whenever you want
to actually run your application or you can press it five.
So I'm just going to start this once.
Notice we didn't write anything Anderson to start it so that you can see what visual studio looks like
when it's starting a program so it goes through what it calls a build where it compiles all of your
code all of the code files that you have on the one project and then it will see.
All right.
Are there any arrows or syntax errors that I need.
And then it launches what you call that console.
So that console looks like command prompt.
I noticed it just flashed off the screen because well it did exactly that.
It launched the console and then looked inside of our main function.
The main function didn't tell it to do anything so it came on the screen.
So that's nothing to do so it came off so that so console applications were they run and they do off
task until they're completing the half completed the task and then they just exit automatically.
Now that's a very quick tour of visual studio.
We have lots of work and a lot of catching up to do so I want to end this one here.
And then when we come back we start writing some C sharp programs.