Project.RemoveItems(IEnumerable<ProjectItem>) Method

Definition

Removes all the specified items from the project. Items that are not associated with this project are skipped.

C#
public void RemoveItems(System.Collections.Generic.IEnumerable<Microsoft.Build.Evaluation.ProjectItem> items);

Parameters

items
IEnumerable<ProjectItem>

The items to be removed.

Remarks

Removing one item could cause the backing XML to be expanded, which could zombie (disassociate) the next item. To make this case easy for the caller, if an item is not associated with this project it is simply skipped.

Applies to

產品 版本
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17