Share via


GAC Temp and Tmp

I see people asking question about the Temp and Tmp directories under GAC.

Yes they are temporary directory fusion uses during GAC Assembly installation and uninstallation. Tmp is used for installation, and Temp is used for uninstallation.

The use of them is described in my article GAC Assemblies: Install and Uninstall.

The reason that fusion needs two temporary folders, is that fusion will always try to clean up the Temp directory used for uninstallation at the end of each installation/uninstallation. If fusion were to use the same temporary directory for installation and uninstallation, fusion may accidentally remove temporary files used by another assembly installation in progress.

Fusion does not clean up Tmp directory (used for installation). When an installation failed, fusion tries to remove the temporary directory it created during the installation. It does not touch anything else, for the same reason above.

Usually you should not see anything in Tmp unless during assembly installation. You may see things under Temp. When fusion is asked to uninstall an assembly, if the assembly is in use, fusion will be able to move the assembly to the Temp directory, but won't be able to delete it. That is OK though. Next time when get a chance, fusion will try to clean up that directory.

Comments

  • Anonymous
    November 17, 2006
    I believe that one of the questions asked however is "why does process explorer show me a path to an image in the temp(tmp) directory instead of somewhere else in the GAC where I'd expect". I believe this only happens with freshly added images and will go away after a reboot, and is due to some kernel file handle identification stuff being cached and not being updated when the file is moved from the temp directory to the final directory? -josh

  • Anonymous
    November 17, 2006
    Yes, Josh, you are right. Any time you open a file, close the file, move the file, you will see it happen. Nothing special about GAC.

  • Anonymous
    November 19, 2006
    > Tmp is used for installation, and Temp is > used for uninstallation. Good thing those names make it clear.  Who would want geeky stuff like tmpinstall and tmpuninstall. Good thing no one would be confused by historical quirks.  Consider this output from a system which was so antique that it didn't even fully utilize long pathnames: C:Documents and Settingsndiamond>set [...] TEMP=C:DOCUME~1ndiamondLOCALS~1Temp TMP=C:DOCUME~1ndiamondLOCALS~1Temp (Mr. Zhang, I assume you didn't code that stuff and I don't blame you.  I thank you for reporting it, I thank you for informing readers.  Nonetheless the fact itself is laughable.  Why didn't someone choose descriptive names?  Sheesh.)

  • Anonymous
    November 22, 2006
    The comment has been removed

  • Anonymous
    November 22, 2006
    Norman, good point. Although you don't really have to know all the stuff:) Brian, I kind of discussed this issue here http://blogs.msdn.com/junfeng/archive/2004/03/22/93708.aspx. The main point is to preserve predictability of the build. Not every machine has the same assembly in GAC.