I have been running "ngen install ..." on an application while it is being developed. But haven't run "ngen uninstall ..." on some of the versions / scenarios (debug etc.) before those assemblies were overwritten. Now I see many *.ni.exe and *.ni.dll in folders of the form "C:\Windows\assembly\NativeImages_v4.0.30319_64\AssemblyName\hashkey". (dlls are also internally developed ones.)
I am using .Net 4.
Is there anyway to uninstall these? I have tried "ngen update" it doesn't seem to touch these orphaned native images. Of course I can delete these manually, but it will upset the ref counts on system dlls on which my assemblies depend, or have worse consequences on .net system.
Apart from taking space, these older assemblies are hurting the startup delay as assembly binder is trying to match the current IL to each of the native assemblies.
Also is there a better way to look what is in the native image cache rather than using command line?
ngen uninstall AssemblyName
does not work? – Yoohoo