public override void RemoveImport(string targetPath) { if (String.IsNullOrEmpty(targetPath)) { throw new ArgumentNullException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "targetPath"); } var root = EnvDTEProjectUtility.GetFullPath(EnvDTEProject); // For VS 2012 or above, the operation has to be done inside the Writer lock string relativeTargetPath = PathUtility.GetRelativePath(PathUtility.EnsureTrailingSlash(root), targetPath); if (VSVersionHelper.IsVisualStudio2012) { EnvDTEProjectUtility.DoWorkInWriterLock(EnvDTEProject, buildProject => MicrosoftBuildEvaluationProjectUtility.RemoveImportStatement(buildProject, relativeTargetPath)); EnvDTEProjectUtility.Save(EnvDTEProject); } else { RemoveImportStatementForVS2013(relativeTargetPath); } }