官术网_书友最值得收藏!

How to do it...

  1. Open Visual Studio 2017.
  2. 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. 
  3. Now, click on the Chapter1.Library solution label. Click File | Add | New Project.
  1. 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. 
  1. Now, in the Name: text box, type Chapter1.Standard.HelloConsole and leave the Location: text box as it is. 
  1. Click OK.
  2. Now, the Solution Explorer (if not visible, press Ctrl + Alt + L) should look like this: 
  1. In the Chapter1.StandardLib.HelloConsole project tree, right-click on the References label and select Add Reference....  
  2. 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. 
  1. Click OK.
  2. In the Solution Explorer, double-click on the Program.cs filename under the Chapter1.StandardLib.HelloConsole project. 
  3. 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;
  1. 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();
  1. Hit F5 and see the code running: 
  1. Press Enter to exit from the Command Prompt
主站蜘蛛池模板: 兴安县| 黄浦区| 汝州市| 永福县| 荔浦县| 武平县| 彰武县| 吉林市| 白玉县| 元谋县| 武宣县| 六枝特区| 望奎县| 九江市| 南靖县| 勃利县| 若尔盖县| 芦山县| 桓台县| 栾城县| 那坡县| 黑龙江省| 肃南| 刚察县| 华容县| 漳州市| 宣城市| 曲松县| 循化| 苍南县| 师宗县| 迁西县| 泰和县| 迁安市| 九江市| 新竹市| 称多县| 黄冈市| 太和县| 克东县| 连平县|