} // Install private void InstallFile(string file) { if (!File.Exists(file)) { Log.LogError("Assembly file '{0}' not found.", file); _failed++; return; } AssemblyName name = AssemblyName.GetAssemblyName(file); string fullName = FusionWrapper.AppendProccessor(name.FullName, name.ProcessorArchitecture); _installedNames.Add(name.FullName); FusionWrapper.InstallAssembly(file, _force); Log.LogMessage("Installed: {0}", name.FullName); string installPath = FusionWrapper.GetAssemblyPath(fullName); _installedPaths.Add(new TaskItem(installPath)); _successful++; if (_includeRelatedFiles) { CopyRelatedFiles(file, Path.GetDirectoryName(installPath)); } }
public void UninstallAssemblyShort() { string path = @"..\..\..\MSBuild.Community.Tasks\bin\Debug\MSBuild.Community.Tasks.dll"; FusionWrapper.InstallAssembly(path, true); UninstallStatus result; bool successful = FusionWrapper.UninstallAssembly("MSBuild.Community.Tasks", true, out result); Assert.IsTrue(successful); }
public void UninstallAssembly() { string path = @"..\..\..\MSBuild.Community.Tasks\bin\Debug\MSBuild.Community.Tasks.dll"; FusionWrapper.InstallAssembly(path, true); UninstallStatus result; bool successful = FusionWrapper.UninstallAssembly("MSBuild.Community.Tasks, Version=1.4.0.0, Culture=neutral, PublicKeyToken=e8bf2261941c3948", true, out result); Assert.IsTrue(successful); }
} // unintall private void UnintallAssembly(string name) { Log.LogMessage("Uninstall: {0}", name); string fullName; string installPath = FusionWrapper.GetAssemblyPath(name, out fullName); if (string.IsNullOrEmpty(installPath)) { Log.LogMessage(" Status: {0}", UninstallStatus.ReferenceNotFound.ToString()); if (!_quiet) { Log.LogWarning("Assembly '{0}' not found in the GAC.", name); } _skipped++; return; } _installedPaths.Add(new TaskItem(installPath)); AssemblyName assemblyName = AssemblyName.GetAssemblyName(installPath); _installedNames.Add(assemblyName.FullName); UninstallStatus status = UninstallStatus.None; bool result = FusionWrapper.UninstallAssembly(fullName, _force, out status); if (result) { _successful++; } else { _failed++; } Log.LogMessage(" Status: {0}", status.ToString()); }
public void GetDisplayName() { AssemblyName name = FusionWrapper.GetAssemblyName("System.Core"); Assert.IsNotNull(name); }
public void QueryAssemblyPath() { string path = FusionWrapper.GetAssemblyPath("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"); Assert.IsNotNull(path); }
public void InstallAssembly() { string path = @"..\..\..\MSBuild.Community.Tasks\bin\Debug\MSBuild.Community.Tasks.dll"; FusionWrapper.InstallAssembly(path, true); }