private void InternalSearchHiddenFilesInFolder(DTE service, Project project, ProjectItem hiveItem) { string pathToProject = Helpers.GetFullPathOfProjectItem(project); if (hiveItem.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder) { string itemFolderPath = Helpers.GetFullPathOfProjectItem(hiveItem); foreach (string childFile in Directory.GetFiles(itemFolderPath)) { //check, if each file in that folder is in the project ProjectItem foundItem = DteHelper.FindItemByPath(service.Solution, childFile); if (foundItem == null) { string relativeFileName = childFile.Substring(pathToProject.Length); Helpers.LogMessage(service, this, "Warning: File " + relativeFileName + " not found in project"); AnalyzeProjectForm form = new AnalyzeProjectForm(relativeFileName); DialogResult result = form.ShowDialog(); if (result == DialogResult.No) { //deletefile Helpers.LogMessage(service, this, "Deleted File " + relativeFileName); File.Delete(childFile); solved++; } else if (result == DialogResult.Yes) { //include in project Helpers.LogMessage(service, this, "Included File " + relativeFileName + " in project"); Helpers.AddFile(hiveItem, childFile); solved++; } else { ignored++; } } } } foreach (ProjectItem childItem in hiveItem.ProjectItems) { InternalSearchHiddenFilesInFolder(service, project, childItem); } }