|
1 | 1 | --- |
2 | 2 | title: Remove unused references |
3 | 3 | description: Learn how to clean up project references and NuGet packages that have no usage with the new Remove Unused References command. |
4 | | -ms.date: 3/6/2024 |
| 4 | +ms.date: 8/15/2025 |
5 | 5 | ms.topic: reference |
6 | 6 | author: mikadumont |
7 | 7 | ms.author: midumont |
@@ -31,20 +31,30 @@ This refactoring applies to: |
31 | 31 |
|
32 | 32 | 1. Verify that the option is enabled. |
33 | 33 |
|
34 | | - Select **Tools** > **Options** > **Text Editor** > **C#** > **Advanced**, and enable **Show "Removed Unused References" command in Solution Explorer (experimental)**. |
| 34 | + Select **Tools** > **Options** > **Text Editor** > **C#** > **Advanced**, and enable **Show "Removed Unused References" command in Solution Explorer**. |
35 | 35 |
|
36 | | -1. Right click on a project name or dependencies node in Solution Explorer. |
| 36 | +1. In Solution Explorer, right click on a project name or the **Dependencies** node. |
37 | 37 |
|
38 | 38 | 1. Select **Remove Unused References**. |
39 | 39 |
|
40 | | -  |
| 40 | + ::: moniker range=">= vs-2022" |
| 41 | +  |
| 42 | + ::: moniker-end |
| 43 | + ::: moniker range="vs-2019" |
| 44 | +  |
| 45 | + ::: moniker-end |
41 | 46 |
|
42 | | -1. The **Remove Unused References** dialog will open displaying references that have no usage in source code. Unused references will be pre-selected for removal with an option to preserve references by selecting `Keep` from the Action drop down. |
| 47 | +1. The **Remove Unused References** dialog opens, displaying references that have no usage in source code. Unused references are pre-selected for removal with an option to preserve references by selecting `Keep` from the Action drop down. |
43 | 48 |
|
44 | | -  |
| 49 | + ::: moniker range=">= vs-2022" |
| 50 | +  |
| 51 | + ::: moniker-end |
| 52 | + ::: moniker range="vs-2019" |
| 53 | +  |
| 54 | + ::: moniker-end |
45 | 55 |
|
46 | 56 | 1. Click `Apply` to remove selected references. |
47 | 57 |
|
48 | 58 | ## See also |
49 | 59 |
|
50 | | -- [Refactoring](../refactoring-in-visual-studio.md) |
| 60 | +- [Refactoring](../refactoring-in-visual-studio.md) |
0 commit comments