0.3 First Day Assignment

Overview

The purpose of this assignment is to familiarize you with errors in Visual Studio, correcting
StyleCop warning, and the Feedback System.

  1. Download the starting code.

    Instructional image from 0.3 First Day Assignment, page 1

    Snip - Restore NuGet Packages

    Go to top
  2. Fix a build error.

    Instructional image from 0.3 First Day Assignment, page 2

    Build Application

    Your Output window should look like the image below.

    Instructional image from 0.3 First Day Assignment, page 2

    Build Output

    Instructional image from 0.3 First Day Assignment, page 3

    Snip - Show Error List

    This will bring up a window that shows you issues with the code. These issues are
    known as compiler errors. Visual Studio has a built in compiler that checks for
    errors as you write code.

    Instructional image from 0.3 First Day Assignment, page 3

    Snip - Error Line

    There are several other 'Warnings' listed. These are StyleCop issues that we will
    handle in the next step. For now, don't worry about them.

    Instructional image from 0.3 First Day Assignment, page 4

    Snip - Build

    Because we have an error in our code the application will not build properly,
    meaning that Visual Studio recognizes that something isn't right and the
    application is not usable. It will show that the build has failed in the status bar on
    the bottom.

    Instructional image from 0.3 First Day Assignment, page 4

    Build Failed

    Every time we start the application, the application saves and then builds first.

    If you get a prompt instead, select 'No' and make sure your Build Settings are
    correct. If you don't get a prompt but the application still runs it means your
    settings are incorrect and you will need to fix them.

    Instructional image from 0.3 First Day Assignment, page 5

    Build Settings

    Instructional image from 0.3 First Day Assignment, page 5

    Snip - Fix Error

    Instructional image from 0.3 First Day Assignment, page 6

    Snip - Build Succeeded

    Instructional image from 0.3 First Day Assignment, page 6

    Snip - Start Application

    Go to top
  3. Fix StyleCop Warnings.

    StyleCop Warnings are generated when code does not meet proper documentation
    standards. These warnings appear in the Error List window and are also shown with
    green lines by the issue.

    Instructional image from 0.3 First Day Assignment, page 7

    Select Build + IntelliSense

    If your Error Window includes warning(s) CS8034 "Unable to load Analyzer
    Assembly..." Please see the instructions in the "Fix Style Cop Guide" link below.

    Instructional image from 0.3 First Day Assignment, page 7

    Snip - Fix Line

    Instructional image from 0.3 First Day Assignment, page 8

    Snip - StyleCop Warnings

    Instructional image from 0.3 First Day Assignment, page 8

    Snip - Blank Line

    /// <summary>
    /// A healthy way to start your day.
    /// </summary>
    Instructional image from 0.3 First Day Assignment, page 8

    Snip - Breakfast Comment

    Instructional image from 0.3 First Day Assignment, page 8

    Snip - Five Errors

    Instructional image from 0.3 First Day Assignment, page 9

    Snip - Comment Skeleton

    Instructional image from 0.3 First Day Assignment, page 9

    Snip - Fill in Comment Skeleton

    Instructional image from 0.3 First Day Assignment, page 9

    Snip - Three Warnings

    Instructional image from 0.3 First Day Assignment, page 9

    Snip - Add this.

    Instructional image from 0.3 First Day Assignment, page 10

    Snip - No Warnings

    Go to top
  4. Upload the First Day Assignment to the Feedback System

    Currently when we build the application everything seems fine. This is all well and good, but when
    we upload to the Feedback System we get errors.

    0.3 First Day 4 Snip ZipFolder
    0.3 First Day 4 Snip ZipFolder.png
    0.3 First Day 4 Snip InsideZipFolder
    0.3 First Day 4 Snip InsideZipFolder.png
    Instructional image from 0.3 First Day Assignment, page 11

    Feedback Assignment

    Instructional image from 0.3 First Day Assignment, page 12

    Upload Button

    0.3 First Day 4 UploadToFBS
    0.3 First Day 4 UploadToFBS.png
    Go to top
  5. Observe Feedback System Errors

    Instructional image from 0.3 First Day Assignment, page 13

    Step Number

    Instructional image from 0.3 First Day Assignment, page 13

    Feedback Errors

    Go to top
  6. Fix your first error.

    Instructional image from 0.3 First Day Assignment, page 14

    Id Error

    Instructional image from 0.3 First Day Assignment, page 14

    Resubmit

    Instructional image from 0.3 First Day Assignment, page 14

    Error Fixed

    Go to top
  7. Fix the next error

    Instructional image from 0.3 First Day Assignment, page 15

    NullReferenceException

    this.Breakfast = new Breakfast();
    Instructional image from 0.3 First Day Assignment, page 15

    New Breakfast Object

    Instructional image from 0.3 First Day Assignment, page 16

    Success Message

    Go to top