Izmantojot Visual Studio 2012 profilētāju uz Windows 8, rezultātu tabulā liela daļa bibliotēku uzrādās kā, piemēram, 'System.Web.ni.dll' – '.ni.dll' norāda, ka tas ir native image – bibliotēka, kas ģenerēta, izmantojot ngen aplikāciju.
Visual Studio ALM blogā ir aprakstīts, kā ar šo problēmu tikt galā. Diemžēl tur piemērs prasa palielu darbošanos komandrindā, apstrādājot katru bibliotēku atsevišķi. Lai tas nebūtu regulāri jādara, izveidoju nelielu PowerShell skriptu, kas to dara automātiski visām bibliotēkām, kuras šobrīd instalētas sistēmā.
Lejupielādēt skriptu. Skripta sākumā ir mainīgais, kurā jāievada sev vēlamā direktorija, nekas cits nav jāmaina, ja pieņem, ka 'C:\Windows' ir īstā direktorija.
Skriptā ir paredzēta arī funkcionalitāte, kas lejupielādē PDB ar pirmkoda informāciju no Microsoft servera un izmanto tos, lai ģenerētu jaunos, taču šobrīd tur pieejamie PDB faili kaut kādā mērā neatbilst tam, ko uzstāda .NET Framework 4.5 uz datora, līdz ar to šo funkcionalitāti nav iespējams izmantot. Ja ir vēlme paeksperimentēt, tad skriptā ir nepieciešamie komentāri.
English version
Download a PowerShell script that automatically creates PDB symbols for all NGEN-ed images on your machine. You will need to change the target path at the start of the script. If 'C:\Windows' is not your path, you will need some more modifications as well to accomodate that.
The details on this topic are available on Visual Studio ALM blog.
The script includes the functionality to download PDB files with source information from Microsoft and use those to generate the new ones. Unfortunately these PDB files do not match the files installed by .NET Framework 4.5 so the code is commented out. If you want to experiment, there are comments what needs to be done in the script.
f64c5199-835d-457a-996c-30841e320f42|4|5.0|015880aa-1e7c-4e05-a104-8c054d966a2e