1 00:00:00,510 --> 00:00:03,019 Welcome back, how did you do? 2 00:00:03,019 --> 00:00:04,831 Don't worry if you ran into any issues, 3 00:00:04,831 --> 00:00:08,900 it's completely natural to struggle when you're learning something new. 4 00:00:08,900 --> 00:00:12,080 Let's walk through how I completed the session. 5 00:00:12,080 --> 00:00:16,736 To create the new C# workspace I clicked on Workspaces in 6 00:00:16,736 --> 00:00:20,034 the main menu of the Treehouse website. 7 00:00:22,827 --> 00:00:27,688 Then here in the top left corner of the list of existing Workspaces, 8 00:00:27,688 --> 00:00:29,238 I click the New link. 9 00:00:29,238 --> 00:00:35,931 In the New Workspace dialogue, I enter the title C# practice session. 10 00:00:37,862 --> 00:00:40,068 Selected C# for the environment. 11 00:00:42,819 --> 00:00:44,779 And clicked Create Workspace. 12 00:00:47,226 --> 00:00:51,471 Once the workspace finished loading, in the new window I selected the File, 13 00:00:51,471 --> 00:00:53,442 New File menu item to add a new file. 14 00:00:57,391 --> 00:01:01,113 And entered Program.cs for the file name. 15 00:01:04,930 --> 00:01:08,620 I then went and grabbed a copy of the code from the teacher's notes for 16 00:01:08,620 --> 00:01:10,390 the first video. 17 00:01:10,390 --> 00:01:14,882 To do that I used the mouse to select the code, and pressed Ctrl+ C, or 18 00:01:14,882 --> 00:01:18,175 Cmd+C on the Mac to copy the code to the clipboard. 19 00:01:23,776 --> 00:01:28,771 I then use the mouse to click into the Program.cs file, and pressed Ctrl+ V, 20 00:01:28,771 --> 00:01:32,570 or Cmd+ V on the Mac, to paste the code from the clipboard. 21 00:01:35,210 --> 00:01:38,826 Don't forget to save the file at this point, you can do that by pressing 22 00:01:38,826 --> 00:01:44,470 Ctrl+ S, or Cmd+ S on the Mac, or select the File, Save menu item. 23 00:01:47,674 --> 00:01:51,372 Just as a quick review, our class is program, and 24 00:01:51,372 --> 00:01:54,640 it's contains a single method named Main. 25 00:01:56,160 --> 00:02:01,070 Remember that C# looks for a method named main when the program is ran. 26 00:02:01,070 --> 00:02:06,970 The Main method contains a single line of code, which will write the text, 27 00:02:06,970 --> 00:02:12,460 I love learning C# at Treehouse, to the console when we run the program. 28 00:02:12,460 --> 00:02:16,190 Speaking of which, let's compile and run our program. 29 00:02:16,190 --> 00:02:21,150 To start you need to make sure that the console is visible by selecting the View, 30 00:02:21,150 --> 00:02:22,390 Show Console menu item. 31 00:02:25,834 --> 00:02:30,287 If the console is currently being displayed, as it is for me, then you'll 32 00:02:30,287 --> 00:02:34,476 see the menu item Hide Console, which allows you to hide the console. 33 00:02:34,476 --> 00:02:40,500 To compile the program, I ran the command mcs Program.cs. 34 00:02:43,829 --> 00:02:48,846 Be sure to capitalize the letter P, if you don't you'll receive an error from 35 00:02:48,846 --> 00:02:53,650 the compiler that the file program.cs with a lower case p can't be found. 36 00:02:58,520 --> 00:03:02,780 If the program was compiled successfully, the command will complete but 37 00:03:02,780 --> 00:03:04,300 you won't see a message. 38 00:03:10,639 --> 00:03:14,867 You can confirm that the command worked by running the ls command, 39 00:03:14,867 --> 00:03:18,960 which will list the contents of the current folder. 40 00:03:18,960 --> 00:03:24,910 We can see that our folder contains two files, Program.cs which is our code file, 41 00:03:24,910 --> 00:03:30,040 and Program.exe, which is our program's compiled executable. 42 00:03:30,040 --> 00:03:36,304 To run the program, I ran the command, mono Program.exe. 43 00:03:40,314 --> 00:03:45,540 And here's the message, I love learning C# at Treehouse written to the console. 44 00:03:47,480 --> 00:03:50,480 Again, if you're unable to get the program to run, 45 00:03:50,480 --> 00:03:55,080 check to make sure you're typing the mono command in all lower case letters, and 46 00:03:55,080 --> 00:04:01,800 that Program.exe starts with a capital P, and ends with .exe. 47 00:04:01,800 --> 00:04:05,330 Doing any part of that incorrectly will result in an error. 48 00:04:06,540 --> 00:04:10,130 Once you've gotten the program to run once, feel free to change the literal 49 00:04:10,130 --> 00:04:14,180 string value that is being passed to the console write line method, 50 00:04:14,180 --> 00:04:17,970 I love learning C# at Treehouse, to whatever you'd like. 51 00:04:25,559 --> 00:04:29,283 Just be sure to recompile the program before you attempt to run it, 52 00:04:29,283 --> 00:04:33,483 otherwise you'll still see the previous message written to the console. 53 00:04:44,027 --> 00:04:45,440 And that's it. 54 00:04:45,440 --> 00:04:47,100 Be sure to keep practicing, and 55 00:04:47,100 --> 00:04:50,900 let us know if you'd like to see more of these practice sessions. 56 00:04:50,900 --> 00:04:51,810 See you next time.