
上QQ阅读APP看书,第一时间看更新
How to do it...
- Open Visual Studio 2017.
- Now, open the solution from the previous recipe. Click File | Open | Open Project/Solution, or press Ctrl + Shift + O, and select the Chapter1.StandardLib solution.
- Now, click on the Chapter1.Library solution label. Click File | Add | New Project.
- In the Add New Project template dialog box, expand the Visual C# node in the left-hand pane. Select Windows Classic Desktop and select Console App (.NET Framework) from the right-hand pane.

- Now, in the Name: text box, type Chapter1.Standard.HelloConsole and leave the Location: text box as it is.

- Click OK.
- Now, the Solution Explorer (if not visible, press Ctrl + Alt + L) should look like this:

- In the Chapter1.StandardLib.HelloConsole project tree, right-click on the References label and select Add Reference....
- Under the Reference Manager dialog box, click on the Projects label in the left-hand pane. In the middle pane, check the Chapter1.StandardLib.HelloUniverse project.

- Click OK.
- In the Solution Explorer, double-click on the Program.cs filename under the Chapter1.StandardLib.HelloConsole project.
- Scroll up till you reach the using directive part of the code and add the following code as the last line of that section:
using Chapter1.StandardLib;
- Now, in between the curly brackets of the Main() method, type the following code:
var myName = "Fiqri Ismail";
var helloMessage = new HelloUniverse();
Console.WriteLine(helloMessage.SayHello(myName));
Console.ReadLine();
- Hit F5 and see the code running:

- Press Enter to exit from the Command Prompt.