/// <summary>
        /// Call Ngen with executeQueuedItems parameters to make sure that all assemblies in the queue have been processed
        /// </summary>
        /// <param name="arch">64 bit or 32 bit</param>
        private static void NgenQueuedBinaries(NetFXVerifier.FrameworkArch arch)
        {
            string ngenPath = GetNgenPath(arch);

            // run ngen
            Tool ngen = new Tool(ngenPath, " executeQueuedItems ");
            ngen.WorkingDirectory = Environment.CurrentDirectory;
            Result result = ngen.Run();
            Console.WriteLine(result.ToString());
        }
        /// <summary>
        /// Find the latest Ngen.exe to use
        /// </summary>
        /// <param name="arch">64 bit or 32 bit</param>
        /// <returns>Path to the latest ngen.exe</returns>
        private static string GetNgenPath(NetFXVerifier.FrameworkArch arch)
        {
            string frameworkFolderName;
            if (NetFXVerifier.FrameworkArch.x86 == arch)
            {
                frameworkFolderName = Environment.ExpandEnvironmentVariables(@"%windir%\Microsoft.NET\Framework");
            }
            else if (NetFXVerifier.FrameworkArch.x64 == arch)
            {
                frameworkFolderName = Environment.ExpandEnvironmentVariables(@"%windir%\Microsoft.NET\Framework64");
            }
            else
            {
                return null;
            }

            DirectoryInfo frameworkFolder = new DirectoryInfo(frameworkFolderName);
            FileInfo[] ngenFileList = frameworkFolder.GetFiles("ngen.exe", SearchOption.AllDirectories);

            if (null == ngenFileList || ngenFileList.Length < 1)
            {
                return null;
            }

            FileInfo latestNgenFile = ngenFileList[0];
            string version = FileVersionInfo.GetVersionInfo(latestNgenFile.FullName).ProductVersion;
            foreach (FileInfo ngenFile in ngenFileList)
            {
                if (FileVersionInfo.GetVersionInfo(ngenFile.FullName).ProductVersion.CompareTo(version) >0)
                {
                    latestNgenFile = ngenFile;
                    version = FileVersionInfo.GetVersionInfo(ngenFile.FullName).ProductVersion;
                }
            }

            return latestNgenFile.FullName;
        }