示例#1
0
        public override bool Execute()
        {
            using (GacUtil util = new GacUtil())
            {
                util.InstallAssemblyFile(m_path);
            }

            return(true);
        }
示例#2
0
        public override void Execute()
        {
            var assembly = Options["i"].Values[0];

            // Iterate across all assemblies.

            using (GacUtil gac = new GacUtil())
            {
                if (gac.InstallAssemblyFile(assembly))
                {
                    Console.WriteLine("Installed '" + assembly + "' into the GAC.");
                }
            }
        }
示例#3
0
        public static void GacAll(string folder)
        {
            // Iterate across all assemblies.

            using (GacUtil gac = new GacUtil())
            {
                foreach (string file in Directory.GetFiles(folder))
                {
                    string fileName = Path.GetFileName(file);
                    if (!string.Equals(fileName, EntryAssemblyFileName, StringComparison.OrdinalIgnoreCase))
                    {
                        // Don't attempt to put Sdk or VisualStudio assemblies in the GAC.

                        if (!fileName.Contains("wix") && !fileName.Contains(".Sdk.") && !fileName.Contains(".VisualStudio."))
                        {
                            if (gac.InstallAssemblyFile(file))
                            {
                                Console.WriteLine("Installed '" + file + "' into the GAC.");
                            }
                        }
                    }
                }
            }
        }