Setting Up a Class Library and Console Application
Learn about creating a clean workspace with a class library and console application, and set up the projects and dependencies.
We'll cover the following
Let’s start the development journey by creating a clean workspace with two projects, a class library, and a console app.
Creating a class library and console application
We will start by defining a workspace or solution with two projects. Follow the instructions below so that we start with fresh working projects:
Step 1: Use your preferred coding tool to create a new project, as defined in the following list:
Project template:
Class Library
orclasslib
Project file and folder:
PacktLibrary
Workspace/solution file and folder:
Chapter06
Step 2: Add a new project, as defined in the following list:
Project template:
Console App or console
Project file and folder:
PeopleApp
Workspace/solution file and folder:
Chapter06
Step 3: In the PacktLibrary
project, rename the file named Class1.cs
to Person.cs
.
Step 4: In both projects, add <ItemGroup>
to globally and statically import the System.Console
class, as shown in the following markup:
Get hands-on with 1400+ tech skills courses.