Creating a library that reads and writes to an XML file
In this recipe, we will be using a .NET Standard 2.0 library to create and write to an XML file. We will also be using the same library to write data to an XML file.
Getting ready
Let's fire up Visual Studio 2017 and get things done. Make sure you have the latest version of Visual Studio 2017 installed.
How to do it...
- Open Visual Studio 2017.
- Click
File|New|Projectto create a project. - In the
New Projectdialog box, expand theOther Project Typesnode in the left-hand pane and selectVisual Studio Solutions. In the right-hand pane, selectBlank Solution. - In the
Name:textbox, typeChapter5.XmlDocand, in theLocation:textbox, select path from the drop-down box or click on theBrowse...button to locate a path:

- Click OK.
- Now, the
Solution Explorer(Ctrl+Alt +L) should look like this:

- Now, right-click on the
Chapter5.XmlDoclabel in theSolution Explorerand selectAdd|New Project. - In the
New Projectdialog box, expand theVisual C#node...