During the Ignite 2021 conference, Microsoft released Visual Studio 2019 version 16.9 which came with several new features and improvements. Microsoft also released a Preview Build of the Visual Studio 2019 version 16.10 with some more improvements for the IDE.
One of these new features is the ability to remove unused binary references from the projects loaded in Microsoft Visual Studio 2019. Let's learn how this can be beneficial for you.
This happens several times when we end up adding a huge list of dll/binary references in our projects. Later, it becomes difficult to find out the unused references and remove them one by one. With the next version of Visual Studio 2019 release, Microsoft is now going to offer you an option to clean up those.
In the first preview build of Visual Studio 2019 version 16.10, Microsoft adds a Remove Unused References command. It can be invoked by right-clicking on the project name or the dependencies node in Solution Explorer and select the "Remove Unused References..." command from the menu.
Once you select the "Remove Unused References..." menu item, it will open a dialog where you can view all the references that can be safely removed. It will also provide you an option to preserve the ones that you want to keep.
Microsoft says that the feature is off by default. You need to enable it from Tools > Options > Text Editor > C# > Advanced tab.