The process cannot access the file 'C:\Users\*******\AppData\Local\Red Gate\SQL Source Control 7\Caches The process cannot access the file 'C:\Users\*******\AppData\Local\Red Gate\SQL Source Control 7\Caches

The process cannot access the file 'C:\Users\*******\AppData\Local\Red Gate\SQL Source Control 7\Caches

This error message from SQL Source Control usually occurs due to an anti-virus or similar software locking the file in a process such as scanning.

We recommend adding the SQL Source Control folders to an exclusion list to resolve this issue.

mceclip0.png

If you still encounter this issue, then the solution is to disable caching altogether in the tool.

To disable caching you would need to edit %localappdata%\Red Gate\SQL Source Control 7\RedGate_SQLSourceControl_Engine_EngineOptions.xml and add the following:

<MaxCacheSizeInMB>0</MaxCacheSizeInMB>

<DisableCaching>True</DisableCaching>

(Please note that %localappdata% usually corresponds to C:\Users(username under which SSMS runs - usually the logged in user)\AppData\Local).

This prevents the cache folder from being populated by the operations you're performing, so the engine options file should look like this:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<!---->

<EngineOptions version="3" type="EngineOptions">

<MaxCacheSizeInMB>0</MaxCacheSizeInMB>

<DisableCaching>True</DisableCaching>

</EngineOptions>

If you close SSMS, change the file, add the new line and delete the Cache folder, it will recreate the Cache folder, but then once you open SSMS and try to perform the operations it shouldn't give you the error anymore.