22

I'm using the new Visual Studio 2017. I follow this tutorial to change the default (temp) path where store .db and such.

It correctly moves *.VC.db files, but I can still see these files into the .vs within the solution's folder:

Solution.VC.db
Solution.VC.db-shm
Solution.VC.db-wal

I'd like to also move these data. How can I do it?

Community
  • 1
  • 1
markzzz
  • 47,390
  • 120
  • 299
  • 507
  • 1
    There is also solname.sqlite. Well, this is pretty useless. Best to report the bug so they can fix it. I don't see them looking at connect.microsoft.com anymore lately, they do respond to developercommunity.visualstudio.com these days. You can limp along for now, these files are relatively small. And *do* always favor source control. – Hans Passant Apr 04 '17 at 08:08
  • Not sure how can I report this – markzzz Apr 06 '17 at 15:54
  • 1
    I wish there was a proper way to really not pollute our source dir with all those giant tmp files that VS creates. There is a way to make it store them in some hardcoded location of TMP dir, not sure how well would it work if you open identical solutions from multiple folders though. – Pavel P Apr 11 '17 at 05:12
  • 1
    @AmitSharma your comment has nothing to do about what he asks. He does not ask about MySQL basics in C#, he asks about how to move those hefty files that Visual Studio add into your project folder under .vs – iantonuk May 15 '17 at 03:06

2 Answers2

9

The guide that is the source of all these tutorials and advices is https://blogs.msdn.microsoft.com/vcblog/2010/03/09/intellisensebrowsing-options-in-vc-2010/

You are trying to get rid from you *.db files in {ProjectDir}/.vs/{SolutionName}/v15{(VS version)}/ and following the old guide for ipch files you successfully moved Browse.VC.db fie. However

Solution.VC.db
Solution.VC.db-shm
Solution.VC.db-wal

Are not browsing files and have nothing to with Intellisense. They are Project Preload files and needed only to speed up VS hefty loading of solutions.

The answer to your question: No, you can not move them to the other folder by the means of VS options. They are supposed to be internal matter of VS speeding up the openage.

2 of this 3 files should disappear when you close the solution( the heaviest one will remain)

However there is a lot you can do about it:

1)You can turn them off completely by Tools->Options->Text Editor->C/C++->Experimental in Enable Faster Project Load = False

2) If you'd like to leave project load(I don't feel much difference, but maybe I don't have very big projects) you can always clean files ad hoc by Project->Properties->Build Event->Post Build and entering any console command you'd like removing files from that folder- that will happen each build, which is what you want in the end when you close it.

3) You can hack their size to zero by using symlinks - just create symlink with the same name(by a script, maybe) that to points to the location you like and VS won't spot the difference.

Also, you can turn off browsing db in the Advanced - it will turn off Intellisense (or leave where you moved it).

I hope it helps to solve this issue with heavy untransportable files.

Hatted Rooster
  • 35,759
  • 6
  • 62
  • 122
iantonuk
  • 1,178
  • 8
  • 28
  • "2 of this 3 files should disappear when you close the solution( the heaviest one will remain)": no, they are always there when I close the solution. – markzzz May 16 '17 at 14:17
  • They are not matter much, because are the many times smaller then the solution.db, but there is an option in advanced that will make them disappear(I just didn't want to be too detailed) – iantonuk May 16 '17 at 14:31
  • Thanks. It solved problem... I always use trick with fallback location to get rid of intellisense database inside my project folder, however it doesn't work for this "awsome" new useless feature... Seems one day we'll end up with 2 Gb crap files to speed up and improve my project with 1kb source... – Mr D Jul 30 '17 at 16:54
  • You're welcome. Yes, from engineer's point of view it should be total nonsense. – iantonuk Jul 30 '17 at 17:39
  • 2
    The option mentioned above doesn't exist any more in VS15.5 (and was apparently [removed in 15.3](https://developercommunity.visualstudio.com/content/problem/96888/test-editor-c-experimental-enable-faster-project-l.html)), the new location is apparently "Projects and Solutions > VC++ Project Settings > Enable Project Caching". – VZ. Feb 10 '18 at 23:12
3

Two things

how to control or manage the path where .vs folder is created?

Currently I couldn't find a way for this - its still created next to solution folder (I am using VS 2019)

how to control or manage the path where the contents (like Browse.VC.db and including the other temp ones like Browse.VC.db-shm, Browse.VC.db-wal & Browse.VC.opendb) are created?

Solution: Use Fallback Location

Visual Studio > Tools > Options > Text Editor > C/C++ > Advanced > Browsing Database Fallback > "Always Use Fallback Location" as true and provide a valid path to "Fallback Location".

After this, I have to restart VS.

This is especially useful when you are using cloud or web drive for your solutions and / or projects and don't want these temp files to clutter and consume more spaces.

Dani
  • 1,825
  • 2
  • 15
  • 29
vml
  • 31
  • 2