Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Running Our Website2:00 with James Churchill
Let’s learn how to run our website using Visual Studio so we can preview it in a browser.
To follow along commiting your changes to this course, you'll need to fork the aspnet-comic-book-gallery repo. Then you can clone, commit, and push your changes to your fork like this:
git clone <your-fork> cd aspnet-comic-book-gallery git checkout tags/v1.5 -b running-our-website
For more information about debugging, profiling, and build configurations in Visual Studio check out these articles.
- Debugging in Visual Studio
- Visual Studio 2015 - Analyze Performance While Debugging in Visual Studio 2015
- Understanding Build Configurations
F5- Start debugging (i.e. build and run your website/project)
To run our website we'll click on the Play button at the top of the screen.
If you prefer to keep your hands on the keyboard, like I do,
you can also press the F5 function key.
Before we do that, let's click the little down triangle on the right-hand
side of the Play button to display a list of the installed browsers.
Using this list, we can select the browser that we want to use to run our website.
Let's select Google Chrome and then click the Play button.
Visual Studio will build our website and load it into the browser that we selected.
Uh-oh, we got a resource cannot be found error.
We can also see the HTTP status code along with a detailed description of the error.
Let's switch back to Visual Studio.
Notice how our environment has changed.
The output panel has been replaced with the Autos and
Call Stack panels, both of which are used for debugging.
We also have a new panel being displayed, the Diagnostic Tools panel.
We're not going to use the Diagnostic Tools during this course.
Click the pin here in the right-hand corner to safely collapse this panel.
To stop our application, click the Stop button.
Our website has stopped running and
our environment returns back to what it was before.
So why did we get the error?
Typically, a 404 error means that you're requesting a page that doesn't exist.
If we look at our project in the Solution Explorer panel,
we don't see any HTML files or anything that looks like an HTML page.
Turns out that NVC websites don't use HTML files to represent pages.
Instead a page is represented by the combination of the controller and a view.
Since our empty project doesn't contain any controllers or views,
we don't have a default or home page which resulted in the 404 error.
Sounds like we need to add a controller and view to our website.
In the next section, we'll do exactly that.
See you then.
You need to sign up for Treehouse in order to download course files.Sign up