public virtual void RemoveFile(string path) { if (!string.IsNullOrEmpty(path)) { var files = MsBuildProject.GetItemsByEvaluatedInclude(path); if (files != null) { MsBuildProject.RemoveItems(files); NuGetProjectContext.Log(MessageLevel.Debug, "RemovedFileToProject", path, ProjectName); } FileSystemUtility.DeleteFileAndParentDirectoriesIfEmpty(ProjectFullPath, path, NuGetProjectContext); } }
private bool PackageReferenceExists(MsBuildProject project, string packageIdentity) { var items = project.GetItemsByEvaluatedInclude(packageIdentity); return(items != null); }