3

Short and plain:

is it safe to delete the contents of %SYSTEMROOT%\assembly\temp as in

rd /s "%SYSTEMROOT%\assembly\temp\*"

on a Windows Server 2008 R2 / SBS 2011 instance? Are any official documentation references or blog posts available?

In one case, I see this folder to have grown as large as 33 GB and this SE post suggests that purging the directory might be an option. In the end, it is called "temp" and apparently this folder is used for .net assembly uninstall procedures - the idea seems to be to move assembly-related files there prior to final deletion.

For one reason or the other, the final deletion is not performed on some instances and the folder keeps on growing. In the specific case I am looking at, the more than 5,600 directories under "temp" date on from May 15th, 2014, ~50 are added every day around 0:00 - 3:30 a.m. (probably as the result of some maintenance job) and each of them contains 1-2 .ni.dll file(s) like mscorlib.ni.dll, system.ni.dll, system.configuration.ni.dll [...]. This seems to repeat every day.

What I am basically looking for is either an official statement that deletion is safe or another supported and documented way to clean it up.

the-wabbit
  • 41,352

2 Answers2

1

Before you try purging this folder you have to consider that files in this folder can be used by certain .Net-applications. That being said you should check if there is any .Net application not cleaning up properly (maybe a self programmed one or a third-party-program).

You should also consider a reboot of the server because this should cause processes to end and Windows to clean that directory at least partially.

This folder can grow in size because of software-installation and -updates not cleaning up properly. However, SOME application might use files in this folder and you cannot rely on those applications to properly block the files from being deleted which can lead to malfunctions.

Purging the folder should be the last solution because it's just fighting the symptoms and not the reason that led to the folder growing that big.

Broco
  • 2,029
0

A bit late, but here's what I found. There is a utility called "gacutil.exe" that is installed with Visual Studio. According to this Microsoft doc, if you run the command gacutil /cdl , it will delete the contents of the download cache.

NOTES:

  • If you install VS 2022 Preview, the default location of the x64 files is:

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\

  • Do NOT rename the file "gacutil.exe". It will fail without warning.

  • Make sure you use the correct file (x86 or x64) according to your OS.

  • gacutil.exe requires the files "gacutil.exe.config" and "gacutlrc.dll" located in the "1033" folder.

Eric
  • 1