There's one .vs folder per .sln file next to the .sln file, that defines the organization of projects in the solution (or sub-solution) in quite a readable fashion. Hacks to clean the solution folder from the cache(s) held in the .vs folder(s):
A) Copy the .sln file(s) out of the repo folder (and edit the project folder locations in the .sln accordingly), and the vs. folder is moved out as well. You might have to maintain a second version of every .sln file inside your repo, though. Manually.
mySolution.sln:
Project("{<ProjectGUIDi>}") = "myProject_i", "myProject_i.vcxproj", "{<ProjectTypeGUIDi>}"
mySolution_moved_out.sln:
Project("{<ProjectGUIDi>}") = "myProject_i", "<PATH_TO_mySolution_REPO>\myProject_i.vcxproj", "{<ProjectTypeGUIDi>}"
B) In terms of disk space (or for a simple include of only one root folder without exceptions in trivial local backup operations, such as the File History) you can also move the .vs folders' contents out by means of the file system. You might need admin privileges, though.
B.1a) Move the .vs folder out, and let a symbolic link point to its new location. mklink /D \\myRepo\.vs \\var\myCaches\mySolution.vs
VSS won't replace the symbolic link. For any trivial local backup operations like copying the solution folder, you'll have to make sure to copy the symbolic link as a symbolic link, not to copy the contents of the linked .vs folder: copy /L
robocopy /SL
...
B.1b) OneDrive would not replicate the link to .vs, but the linked content of .vs. Thus, for OneDrive the solution was the other way round: place your repo outside of the OneDrive folders, and in a OneDrive folder make a symlink tree with symbolic links to those folders or files only that you really want OneDrive to replicate.
B.2) Empty the .vs folder and mount a (virtual) disk volume onto the .vs folder. VSS will rebuild the contents of the .vs folder(s). You'll need to make sure the (virtual) disk is already mounted before running VSS, though. A fine solution for a huge .vs directory, but quite some overhead if you work with more than one single solution, or .sln file, respectively. Since you might want to relocate also the intermediate directorys to a place next to the .vs directory, you could consider a combination of (B.1) and (B.2).
.vs
folder contains Roslyn cache, but that does not mean it is generated by Roslyn. Other IDE components, such as IIS Express support, also place their files there. – Swamper