// If you use this, fusion will do the streaming & commit public static void InstallAssembly(string assemblyPath, InstallReference reference, AssemblyCommitFlags flags) { if (reference != null) { if (!InstallReferenceGuid.IsValidGuidScheme(reference.GuidScheme)) { throw new ArgumentException("Invalid argument( reference guid)."); } } IAssemblyCache asmCache = null; COM.CheckHR(CreateAssemblyCache(out asmCache, 0)); COM.CheckHR(asmCache.InstallAssembly((int)flags, assemblyPath, reference)); }
public static void UninstallAssembly(string assemblyName, InstallReference reference, out AssemblyCacheUninstallDisposition disp) { AssemblyCacheUninstallDisposition dispResult = AssemblyCacheUninstallDisposition.Uninstalled; if (reference != null) { if (!InstallReferenceGuid.IsValidGuidScheme(reference.GuidScheme)) { throw new ArgumentException("Invalid argument (reference guid)."); } } IAssemblyCache asmCache = null; COM.CheckHR(CreateAssemblyCache(out asmCache, 0)); COM.CheckHR(asmCache.UninstallAssembly(0, assemblyName, reference, out dispResult)); disp = dispResult; }