1. Preventing Visual Studio from automatically removing imports or usings.
- Click Tools > Options….
- Expand Text Editor.
- Click Code Cleanup.
- Click Configure Code Cleanup.
- Click Remove unnecessary imports or usings.
- Click Down arrow button.
- Click OK button.