2 Building a console application
This chapter covers
- Generating projects with templates
- Creating and using namespaces
- Importing NuGet packages
Chapter 1 introduced .NET concepts and the breadth of applications where it can be used. Now it’s time to put this into practice and start writing apps. If you’ve programmed with .NET Framework before, you’ll want to read through this chapter as there are many differences from the Framework. .NET Core developers will find a lot of similarities but may be surprised by the minimal APIs. To install .NET, follow the instructions for your OS at https://dotnet.microsoft.com/download. All you need is a terminal/command line and a text editor. If you’re interested in more information about IDEs (Integrated Development Environments) for .NET, check out appendix B, Setting up your development environment.
As discussed in chapter 1, .NET works in many types of applications. There are three types of applications used throughout this book: console applications, web applications, and web services. Except for chapter 15, MAUI, this book’s examples will use only these application types. Many of the samples will work in any of these three so you can use whatever you feel most comfortable with. We’ll start with console applications.