SharePoint Designer: Clearing the cache

SharePoint Designer sometimes is out of sync with SharePoint. SharePoint Designer will incorrectly show items as checked out (or checked in) and refuses to be update with the actual status. In some cases the following error will be shown when trying to check out/in an item.

“Cannot perform this operation. The file is no longer checked out or has been deleted.”

Solution
The solution to this problem is to clear the cache of SharePoint Designer.

1. If opened close SharePoint Designer
2. Open the folder %APPDATA%MicrosoftWeb Server ExtensionsCache
3. Delete the contents
4. Open the folder %USERPROFILE%AppDataLocalMicrosoftWebsiteCache
5. Delete the contents
6. Problem solved.

Share

11 Replies to “SharePoint Designer: Clearing the cache”

  1. Thank-you this can probably be automated with a PowerShell Script. Thanks for your good work in isolating this quirk. Don’t you think this might qualify to Microsoft as a bug fix with designer?
    Stephan Onisick

    1. This should do the job, please test before use:

      $spd = Get-Process spdesign -ErrorAction SilentlyContinue

      If(!$spd){
      $appdata = $env:APPDATA
      $userprofile = $env:USERPROFILE

      $webservext = $appdata + “MicrosoftWeb Server ExtensionsCache”
      $webcache = $userprofile + “AppDataLocalMicrosoftWebsiteCache”

      Write-Host “Clearing Web Server Extensions cache” -ForegroundColor Yellow
      Remove-Item -Path $webservext -Recurse
      Write-Host “Web Server Extensions cache cleared” -ForegroundColor Green

      Write-Host “Clearing Web Site cache” -ForegroundColor Yellow
      Remove-Item -Path $webcache -Exclude *.xml -Recurse
      Write-Host “Web Site cache cleared” -ForegroundColor Green
      }
      else{
      Write-Host “SharePoint Designer running, close and re-run” -ForegroundColor Magenta
      }

      1. By the way, the script as Simon added, works. I created a ps1 file which is being executed by a .bat file, right before I open sharepoint designer. Quite handy.

  2. Also works if workflows suddenly become blank or empty which was what happened to me! Following the instructions in this post fixed the issue. Thank You !! ~B

  3. To those asking about a Powershell script… The Batch script that was included is just fine as a stand-alone. Why complicate things? .bat files run against Explorer folders, not SharePoint, and .bat files can run without the overhead of PS just fine with a double-click, on any Windows platform. There’s no advantage to adding the extra PS layer to this. This is SP Designer’s cache, not SharePoint’s, so it’s not like you’ll need to be running this script in the middle of a SharePoint page load routine, or workflow or WSP deployment or something…. Maybe someone would like to inform me about the reasoning to go the extra mile?

  4. And to Ben…. Many thanks for the script – it helped solve an issue where a file was checked out, we created a copy of it, discarded the check-out on the original, then in Explorer view, deleted the original and renamed the 2nd file the original’s name. SP Designer saw the file had the same name as the original and thought it was still checked out. The script solved the problem – thanks again, Ben.

Leave a Reply

Your email address will not be published.