Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default location for *.db?

Tags:

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?

like image 774
markzzz Avatar asked Mar 27 '17 08:03

markzzz


People also ask

Where is the default location for SQL database?

If you chose the default settings when installing the Microsoft SQL Server, the path is C:\Program Files\Microsoft SQL Server\MSSQL\Data.

Can we change the location of the database after creation of database?

Moving the Resource DatabaseThe database cannot be moved.

How do I change the default database schema?

In the Database Administration view upper pane, select the database. Right-click the database and select Set default schema. The Set default schema dialog appears.


2 Answers

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.

like image 165
iantonuk Avatar answered Oct 14 '22 17:10

iantonuk


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.

like image 22
vml Avatar answered Oct 14 '22 15:10

vml