- .NET Standard 2.0 Cookbook
- Fiqri Ismail
- 269字
- 2021-06-25 22:11:34
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.
推薦閱讀
- Progressive Web Apps with React
- SoapUI Cookbook
- Visual FoxPro程序設計教程(第3版)
- Vue.js 3.x從入門到精通(視頻教學版)
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- Python測試開發入門與實踐
- Python網絡爬蟲從入門到實踐(第2版)
- Scientific Computing with Scala
- 微服務從小白到專家:Spring Cloud和Kubernetes實戰
- Unity&VR游戲美術設計實戰
- 機器學習微積分一本通(Python版)
- 軟件工程基礎與實訓教程
- Hands-On Dependency Injection in Go
- Data Manipulation with R(Second Edition)
- ANSYS FLUENT 16.0超級學習手冊