public override bool Execute() { using (GacUtil util = new GacUtil()) { util.InstallAssemblyFile(m_path); } return(true); }
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."); } } }
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."); } } } } } }