Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Let's use Visual Studio Community to create our ASP.NET MVC website project.
Additional Learning
If you want to learn more about how to use GitHub with Visual Studio, be sure to check out this workshop.
Deploying Your Website
If you want to learn how to deploy your ASP.NET MVC website to the cloud, check out these resources.
To deploy your website to a hosting provider, check out your hosting provider's support pages for instructions specific to that provider.
Code Editors
Code editors are a great lightweight option for writing code in a variety of languages, including HTML, CSS, and JavaScript. Here are links to some popular options.
*Important Note About Visual Studio Code: Even though the name contains the words "Visual Studio", Visual Studio Code is not the same application as Visual Studio Community. Visual Studio Code is a code editor that can be used to write HTML, CSS, and JavaScript (and more). It cannot be used to develop ASP.NET 4.x applications.
-
0:00
For first time users, Visual Studio can be a little overwhelming.
-
0:04
There's a lot happening in the user interface, especially when compared to
-
0:08
work spaces, here at Treehouse or other text editors, like Sublime Text or Adam.
-
0:13
For now, we're going to just focus on the parts that we need and
-
0:17
ignore everything else.
-
0:19
Let's open Visual Studio and create our project.
-
0:23
To start the process, click on the File, New, Project menu item, in the top menu.
-
0:31
This opens up the New Project dialog.
-
0:34
Using the tree view on the left-hand side,
-
0:36
we can filter the available project templates by our language in platform.
-
0:41
We're interested in doing web development using C#, so let's select our language,
-
0:46
Visual C#, which was already selected, then our platform, Web.
-
0:51
Now we're seeing just the project templates that are specific
-
0:54
to the web platform.
-
0:56
The first and only item in the list, the ASP.Net Web Application project template,
-
1:01
is the one that we're looking for.
-
1:03
Go ahead and click it to select it.
-
1:06
Notice the panel on the right-hand side of the dialog for Application Insights.
-
1:11
Application Insights is a powerful application profiling tool, but in
-
1:15
the spirit of keeping things simple, make sure that this checkbox is not checked.
-
1:21
Let's take a closer look at this combo box, near the top of the dialog.
-
1:25
If we open this combo box,
-
1:27
we'll see a list of the .NET Framework versions that we currently have installed.
-
1:32
The .NET Framework is updated over time with new features and bug fixes, so
-
1:36
it's not unusual to have more than one version installed.
-
1:39
I'm gonna select the latest version in the list, which for me is 4.6.1.
-
1:46
Don't worry if your version is newer than mine,
-
1:49
as .NET is constantly updating for the better.
-
1:52
Next, let's go to the bottom of the dialog and
-
1:54
change our project name to something other than WebApplication1.
-
1:58
How about, MyFirstWebsite.
-
2:05
Let's go ahead and leave the default values for the Location and
-
2:08
Solution name fields, and make sure that the Create directory for
-
2:13
solution checkbox is checked, and the Add to source control checkbox is not checked.
-
2:19
While we're not using a version control system for this workshop, rest assured,
-
2:23
Visual Studio plays nicely with popular tools like Git or GitHub.
-
2:28
For information about this, see the teacher's notes.
-
2:31
Click the OK button to continue to the next step.
-
2:35
Now we're presented with the second step in the process,
-
2:38
the new ASP.NET Project dialog.
-
2:42
Within this dialog, we can view and
-
2:44
select the specific ASP.NET Project template that we want.
-
2:48
For now, let's focus in on the ASP.NET 4.6.1 template section,
-
2:53
and in particular, the third item in the list, the MVC Project template.
-
3:00
Future releases of ASP.NET might diverge significantly from the version that
-
3:04
I'm using here, so make sure that you're using one of the 4.x templates.
-
3:08
On the right-hand side of the dialog, we can specify the authentication options for
-
3:13
our project.
-
3:15
By default, Visual Studio will include support for individual user accounts.
-
3:20
That allows users to register and log in to our website.
-
3:24
Again, let's keep things simple and remove that option.
-
3:27
To do that, click the Change Authentication button,
-
3:31
and then select the No Authentication option, then click OK.
-
3:36
This will make it so
-
3:37
that anybody could visit our website if we were to publish it on a public server.
-
3:42
Lastly, make sure that the Host in the cloud checkbox,
-
3:45
listed underneath the Microsoft Azure section, is not selected.
-
3:50
While that deployment option would be helpful,
-
3:52
if we were planning on deploying our application to the cloud,
-
3:55
that's not something we're going to cover in this workshop.
-
3:58
If you're interested in deploying your website to the cloud or
-
4:00
a hosting provider, again, check the teacher's notes for a list of resources.
-
4:05
Now that we have all of our options set, go ahead and click the OK button.
-
4:10
Visual Studio will start to create our project,
-
4:13
displaying the status in the dialog, at the center of the screen.
-
4:18
Once the dialog has closed, we now have our project.
-
4:23
Seems like a lot of steps, doesn't it?
-
4:26
The first time that you create a new project, it can seem a little daunting,
-
4:30
but with a little practice, it will start to feel familiar in no time.
-
4:34
Let's take a short break.
-
4:36
When we return, we'll use Visual Studio to run our website so
-
4:39
that we can preview it in a browser.
-
4:41
See you in a bit.
You need to sign up for Treehouse in order to download course files.
Sign up