private async Task RemoveImportStatementAsync(string relativeTargetPath) { await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await ProjectHelper.DoWorkInWriterLockAsync( VsProjectAdapter.Project, VsProjectAdapter.VsHierarchy, buildProject => MicrosoftBuildEvaluationProjectUtility.RemoveImportStatement(buildProject, relativeTargetPath)); // notify the project system of the change UpdateImportStamp(VsProjectAdapter); }
private async Task AddImportStatementAsync(ImportLocation location, string relativeTargetPath) { await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await ProjectHelper.DoWorkInWriterLockAsync( EnvDTEProject, VsHierarchyUtility.ToVsHierarchy(EnvDTEProject), buildProject => MicrosoftBuildEvaluationProjectUtility.AddImportStatement(buildProject, relativeTargetPath, location)); // notify the project system of the change UpdateImportStamp(EnvDTEProject); }