Start Visual Studio for Mac, and navigate to File
| New Solution
.
In the list on the left, in the .NET Core
section, select App
.
In the project template list in the middle, select Console Application
, and then click on Next
, as shown in the following screenshot:
In the Configure your new Console Application
step, select a Target Framework
of .NET Core 2.0
, and click on Next
.
In the Configure your new Console Application
step, enter Project Name as
WelcomeDotNetCoreMac
, enter Solution Name
as Chapter01
, set the Location
to your Code
folder, and click on Create
, as shown in the following screenshot:
Modify the text that is being written to the console to say, Welcome, .NET Core on the Mac!
In Visual Studio for Mac, navigate to Run
| Start Without Debugging
, or press Cmd + Option + Enter.
The output in Terminal
will show the result of running your application.
In the Solution
pad, right-click on Chapter01
, and go to Add | Add Existing Project...
.
In the HelloCS
folder, select HelloCS.cs.proj
.
In the Solution
pad, right-click on HelloCS
, and select Run Item
, as shown in the following screenshot:
You now know how to create and build simple .NET Core applications for Windows and macOS (and Linux is just as easy).
You will be able to complete almost all of the chapters in this book using Visual Studio 2017 on Windows, Visual Studio for Mac, or Visual Studio Code on Windows, macOS, or Linux.