In Solution Explorer, navigate to the folder where you want to ignore files and/or folders.
Select one or more items.
Right-click, select Ignore Rules, and select one of these options:
Ignore <file/folder name>
Ignores a specific file or folder.
Ignore <file/folder name> recursively
Ignores a specific file or folder recursively.
Ignore *.<file extension>
Ignores all the selected file types.
Ignore *.<file extension> recursively
Ignores all the selected file types recursively.
The appropriate ignore rules are added to the .dmignore file and you do not need to add them manually.