How do I programmatically unload a project from a solution?
;
http://blogs.msdn.com/quanto/archive/2008/01/07/how-do-i-programmatically-unload-a-project-from-a-solution.aspx
대강 발췌해 보면,,,
---------------------------------------------
DTE dte = GetService(typeof(SDTE)) as DTE;
Debug.Assert(dte != null);
//Get the selected project
Project selectedProject = null;
if (dte.SelectedItems.Count > 0)
{
selectedProject = ((SelectedItem)dte.SelectedItems.Item(1)).Project;
}
if (selectedProject != null)
{
IVsSolution solutionService = GetService(typeof(SVsSolution)) as IVsSolution;
Debug.Assert(solutionService != null);
IVsHierarchy selectedHierarchy;
ErrorHandler.ThrowOnFailure(solutionService.GetProjectOfUniqueName(selectedProject.UniqueName, out selectedHierarchy));
Debug.Assert(selectedHierarchy != null);
ErrorHandler.ThrowOnFailure(solutionService.CloseSolutionElement((uint)__VSSLNCLOSEOPTIONS.SLNCLOSEOPT_UnloadProject, selectedHierarchy, 0));
}