Visual Studio for Mac: Cache Location

16.4k views Asked by At

EDIT: I didn't include the fact that I was leveraging the MySql.Data package to connect to MySql via LINQ, as it didn't seem relevant. After asking the question, I switched to the LinqToDb.MySql package and the problems seems to have disappeared, so I think it was a bug in MySql.Data.

Though I'm good to go, I'm leaving the question up as my solution and an answer to the original question might help someone else.

Original Post:

I am building a C# solution in Visual Studio Community for Mac (7.1.3). I've changed some references to database table names, but keep getting errors like:

Table 'database.exampleTable1' doesn't exist.` 

even though I've changed the references to "exampleTable1" to "table1" throughout my code in order to match the live database.

I don't think the problem lies within my code, but within Visual Studio not recognizing the change. I've tried emptying out the Debug folder and rebuilding, cloning the project from my git repository and giving it a different name (the curse followed me!), and a few other far-fetched ideas.

This answer seems to have it. It suggests clearing out the Visual Studio cache files, but only shows the path to those folder for a PC. I can't find anything similar on my Mac file system.

Where can I find the equivalent cache files to the following on my Mac?

C:\Documents and Settings\Administrator\Local Settings\Temp\VWDWebCache

or

C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\WebsiteCache
2

There are 2 answers

0
Carl On

Actually, VS Code on a Mac will not have its cache folders under $HOME/Library/Caches, instead it will be located under the so called user directory.

The user directory will always be $HOME/Library/Application Support/Code/, unless, either,

  • you installed VS Code as a portable install - then the user directory will be under the installation path, or
  • you invoke VS Code with --user-data-dir <dir> - then the user directory will be <dir>

Confirming the above on my machine:

$ ls -d "./Library/Application Support/Code/"* | grep -i cache
./Library/Application Support/Code/Cache
./Library/Application Support/Code/CachedData
./Library/Application Support/Code/CachedExtensionVSIXs
./Library/Application Support/Code/CachedExtensions
./Library/Application Support/Code/Code Cache
./Library/Application Support/Code/GPUCache

Another reference here.

You can also see my answer here.

3
Chisx On

Where can I find the equivalent cache files to the following on my Mac?

Open Finder > use command 'Shift + CMD + G' > type/paste "~/Library/Caches." into the Go-To folder dialog. Once you've done this you should be able to see pretty much all caches. So edit at your own risk.


For your exact example:

You may need to look for (I recommend using the list view in finder for ease of sight) 'VisualStudio' folder, drop it down and you should find all cache items here including the folder 'Temp'.

  • As for finding 'VWDWebCache' or 'WebsiteCache' try searching them and refining the search to "Caches" folder again.