11

I've noticed a huge amount of disk space being used recently and finally did some investigating. I found out that I have over 200 GB in the following directory:

C:\Users\compUser\AppData\Local\Temp\nunit20\ShadowCopyCache

Should I delete this data directly? Or is there a function in NUnit to do some sort of clean up for this Shadow Copy Directory that automates this process and doesn't have the potential to break anything?

Updating based on answer:

Open your favorite command prompt application, navigate to the NUnit directory and run the following command:

nunit.exe /cleanup

Depending how large the Shadow Cache is, it could take some time to finish.

5StringRyan
  • 3,604
  • 5
  • 46
  • 69
  • You can safely turn the option off (in the NUnit Gui-Runner settings dialog) if you dont recompile the tests and keep NUnit open. Its surprising how much information there is about this making lots of files but little on what it actually does! After some hunting around the NUnit documentation I found it here http://www.nunit.org/index.php?p=optionsDialog&r=2.4.8 – JonnyRaa Oct 23 '13 at 13:25

2 Answers2

11

A new /cleanup commandline option deletes NUnit's shadow copy cache and then exits.

See here (Nunit release notes) for additional information.

This is a safe and supported delete of this directory.

Bob2Chiv
  • 1,858
  • 2
  • 19
  • 29
  • 1
    just a heads-up on this command, it runs as a background process. it'll look like it completed in like 0 seconds on the command prompt, but will perform the cleanup in the background. This was my experience with it anyway on 2.6.4. I also ran the command prompt as administrator as it didn't appear to do anything the first time (could have been that I didn't understand the background process bit) – Nick Molyneux Jun 24 '16 at 15:49
0

For those of you still running nunit 2 console there is a command line switch to prevent generation of shadow copies in the first place (see documentation):

/noshadow

As of nunit 3 this is default behavior: Made not shadow copy default for console

toATwork
  • 1,335
  • 16
  • 34