Search code examples
copy-protectionngen

What is the list of all NGen artifacts that we should add to our UWF write filter exceptions list?


I know that Ngen places its assemblies in C:\windows\assembly\NativesImages_*. But I also know that it keeps track of the references for each assembly so that if B and C depends on A then uninstalling B doesn't uninstall A. This makes me conclude that there are at least another location NGen uses to keep track of the reference count and any other related metadata, am I right?

The problem is that I am getting "Ngen error because Mscorlib.dll does not have a native image" and nothing gets optimized.


Solution

  • So as I expected, NGen uses the Windows Registry to do its book keeping. Adding the following exceptions solved my problem:

    uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework"
    uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOTWARE\Microsoft\Net Framework Setup"