TL;DR: Do NOT delete this folder
(see below for workarounds)
Why Not?
There have been conflicting reports about whether the absence of this folder (as a consequence of deleting it) will actually and in all cases cause issues with the visual studio installation, i.e. during normal operation, during reinstall, patch/upgrade, repair install, or uninstall. However, the recommendation from MICROSOFT is clearly to NOT DELETE IT.
From Microsoft Developer Tools Blogs → HERE
When repairing, modifying, or uninstalling a product or when
installing or uninstalling a patch, if source media is required the
package cache is used automatically and most users will never see a
prompt. Only if the package cache is missing or incomplete will Visual
Studio setup prompt to download (if connected) or locate media as
shown in the screenshot below.
Users who have installed from media even get the option to download
(if connected). So while very few customers should ever see this
dialog, we wanted to make sure the experience was easy.
Even though we
will prompt to download packages to the cache if missing, we recommend
users do not remove the package cache. Not only is the cached used by
many other products that are installed with Burn and may not provide the same download experience, there are scenarios when
Windows Installer may require source that we cannot handle because our
code is not running.
Solution/Work-Around:
If you need to reclaim this space, your safest bet is to avoid "deleting" anything, but to instead, move this folder and all it's files. You can safely do this following the instructions below to any local/live, online, near-line, or offline storage as long as that storage system that can be mounted to a drive letter or any mount point on the NTFS file system. Any of the following will work:
- another live (mounted) partition
- an optical disc (CD, DVD, etc.) with a live filesystem like FAT, or NTFS
- an external hard drive
- a USB drive
- a network drive
Whenever you are prompted for the media/receive any errors about missing files/missing location, you simply make sure to remount/reinsert your drive/media if it's not already a live partition.
Once moved, in order to "link" the old mount point/location (in most cases C:\ProgramData\Package Cache\
), you simply create a directory junction
to it.
Junctions
are recognized at the file system
level as an alias entry in the FSTAB
. Therefore, it's transparent to all programs, including the OS itself. In other words, it is NOT seen as a file that simply points to another location (like a shortcut
) and therefore always works without incident.
- You would move the folder(s) in question to its new location
Create the junction
Option 1. (natively): Just issue the built-in Windows Vista / 7 / 8 command and the cmd prompt:
mklink /J oldpath newpath
NOTE: If you make the newpath
absolute, you'll be able to move link without breaking the pointer to the newpath
. If you make the newpath
relative, you'll be able prevent breaking the link, as long as you move BOTH the link and target TOGETHER and maintain their relative paths.
Option 2. (using a tool): Another GREAT alternative is a free handy utility I've been using for years called "Link Shell Extension". LSE is free and you can find it here (or Google for it): http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html
LSE allows you to create symlinks, hardlinks, junctions, smartcopies, smartclones, smart mirrors, smart moves, splices, multiple sources, and bunch of other stuff I found too confusing to read, frankly. But, it's a brilliant free product that creates a Windows Explorer context menu that allows you right-click on your LINK-TARGET folder then drag it to where you'd like to create the actual link. You can of course rename the link to anything you'd like.
See my answer below. After uninstalling Visual Studio it had left this directory behind. I deleted it and have had no problems. In my answer I say YES is the answer. – SDsolar – 2017-06-03T11:00:16.897
4I would suggest against anything that's more than 50MB in size, it's used for something. Try moving them to your desktop or something, running it, and if it crashes, move them back. – Jon – 2012-08-04T03:13:18.233
1I can't really test my original scenario but I recall that everything uninstalled fine. Since there are several people saying they have had issues, I've revoked the accepted answer. Keep in mind that I was using 2012 RC. – Ben L – 2013-11-13T23:47:51.420
@BenL even though I understand when you say "I can't really test my original scenario but I recall that everything uninstalled fine. Since there are several people saying they have had issues, I've revoked the accepted answer." I think my answer below (the most popular one so far) allows anyone, in any case, to work around the issue by moving and pointing the folder to a drive with more space. It will even work with offline media. So, you can simply remount/insert your archive DVD/reconnect your external drive, if that's where you move this too, at the time of uninstall, repairs, etc. – Flak DiNenno – 2014-02-02T15:09:52.363
1@FlakDiNenno I like your workaround. But the question is about if it's safe to delete, not if it's safe to mount or offline. – Ben L – 2014-02-03T16:12:39.567
@BenL Good point. I've added some detail and a link from Microsoft that definitely recommends that you DO NOT delete the folder and why. – Flak DiNenno – 2014-02-16T00:28:15.113