If you are brave enough to look at Whidbey's native image cache, you will see some odd directories ended with '#'.

C:\WINDOWS\assembly\NativeImages_v2.0.40607_32>dir *#
 Volume in drive C has no label.
 Volume Serial Number is 685B-4400

 Directory of C:\WINDOWS\assembly\NativeImages_v2.0.40607_32

07/08/2004  01:59 AM    <DIR>          Microsoft.Build.Eng#
07/08/2004  01:59 AM    <DIR>          Microsoft.Build.Fra#
07/08/2004  01:59 AM    <DIR>          Microsoft.Build.Tas#
07/08/2004  01:59 AM    <DIR>          Microsoft.Build.Uti#
07/08/2004  02:08 AM    <DIR>          Microsoft.VisualBas#
07/08/2004  02:59 AM    <DIR>          Microsoft.VisualStu#
07/08/2004  02:00 AM    <DIR>          System.DirectorySer#
07/08/2004  02:00 AM    <DIR>          System.Drawing.Desi#
07/08/2004  01:59 AM    <DIR>          System.EnterpriseSe#
07/08/2004  02:03 AM    <DIR>          System.Web.RegularE#

What is going on here?


Actually, we were using the assembly simple name as the directory name. But someone comes up really long assembly name. The native image file paths of those assemblies exceed MAX_PATH limit.  As a result, those assemblies cannot be ngened.


We could ask them to shorten their assembly name. Of course, we don’t have much luck of doing that. So we limit the directory name to 20 characters, and set the last character to ‘#’ to indicate this is truncated assembly name.


The directory one level down uniquely identities the native image. So name collision is not a problem.

Comments (4)

  1. lexp says:

    Maybe it’s better to limit directory name to 40 characters? In this case all System.* assemblies would be non-truncated.

  2. Why does %WINDIR%assembly need to restrict itself to MAX_PATH? You have the opportunity to use 2^31 characters there instead, and let a shell extension take care of presenting such a large path to a human.

    And if somebody needs to mess around with these paths then they would have to think twice about it, because they just can’t type "rd %windirassemblysomewhere /s/q" but must first implement a rd-prog which supports 2^31 characters 🙂

  3. The choice of 20 character is arbitrary, since this directory is really just informational. You are not supposed to poke into native image cache anyway.

    Andreas, good idea:)

Skip to main content