Let's have a look at using Reflections in this recipe. We have built a small .NET Standard 2.0 library in the last recipe. Now we will be creating a .NET Core-based console application and use reflections to describe our library. We will be using the System.Reflection
namespace and a few of its classes
Let's make sure you have completed the previous recipe and, if not, complete it and come back to this one. Open Visual Studio 2017 and locate and open the previously built .NET Standard library.
- 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 theChapter2.Reflections
solution. - Press Ctrl + Shift + B for a quick build to check that everything is fine.
- Now click on the
Chapter2.Reflections
solution label. ClickFile
|Add
|New Project
. - In the
Add New Project
template dialog box, expand theVisual C#
node in the...