I am working on a VB.NET project in Visual Studio 2017 and need to clean up my code by identifying unused variables. I would like Visual Studio to automatically highlight or notify me of any variables that are declared but not used in the code. For example, if I declare a variable like

Dim tempValue As String = ""
but do not use 'tempValue', I want to be alerted to this. I have tried configuring similar settings for C# by adjusting the Code Style --> Var Preferences--> warning , to show warnings for unused variables, but I found that this specific setting is not available for VB.NET.

Are there configurations or alternative methods available to achieve this in VB.NET that can enable warnings or errors for unused variables for visual studio 2017 or higher versions?"