- 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 Chapter6.ThreadPools solution.
- Press Ctrl + Shift + B for a quick build to check that everything is fine.
- Click on the Chapter6.ThreadPools 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) in the right-hand pane:
- In the Name: textbox, type Chapter6.ThreadPools.PoolConsole as the name of the project. The rest of the fields can be left as they are:
- Click OK.
- Now, the Solution Explorer (press Ctrl + Alt + L) should look like this:
- Right-click on the References label in the Chapter6.ThreadPools.PoolConsole.
- Select Add Reference.
- In the Reference Manager, click on the Projects label in the right-hand pane:
- Check Chapter6.ThreadPools.PoolLib project in the left-hand pane.
- Click OK.
- Double-click on the Program.cs label in the Solution Explorer.
- Scroll up in the code window and add the following using directive:
using Chapter6.ThreadPools.PoolLib;
- Let's add the code inside the Main() method:
var pool = new ThreadList();
var output = pool.ProcessPool();
Console.WriteLine(output);
Console.ReadLine();
- Now, press F5 to test our application:
- Press Enter to exit the application.