In this recipe, we will be looking at creating a .NET Standard 2.0 library and moving the default count code into the library. The counting code was created by Visual Studio for Mac as a default template for the Android app.
Make sure you have completed the previous recipe that creates a default Android Application. If you have already completed it, let's open up that solution and get started.
- Open
Finder
. - Click
Applications
in the left-hand pane. - Now, double-click on the Visual Studio icon.
- Click on
Open
, locate theChapter9.Xamarin
solution, and open it. - The
Solution Explorer
should look like this:
- Now, control (^) + click on the
Chapter9.Xamarin
label and selectAdd
|New Project
. - In the
New Project
dialog box, scroll down the left-hand pane until you see theMulti Platform
section.
- Click on
Library
and select.NET Standard Library
underGeneral
in the right-hand pane. Also make sureC#
is selected:
- Click
Next...