Version: 2022.1
public static PackageManager.Requests.RemoveRequest Remove (string packageName);

参数

packageName The name of the package to remove from the project. ArgumentException is thrown if packageName is null or empty.

返回

RemoveRequest A RemoveRequest instance, which you can use to get the success or failure of the Remove operation.

描述

Removes a package dependency from the project. Removing a dependency often leads to changing installed packages, but only after the Package Manager constructs a dependency graph to solve any version conflicts. For more information, see Dependency and resolution.

Remove() is an asynchronous operation. Before the operation is complete, you can use the RemoveRequest instance to monitor the asynchronous operation.

注意:在调用此方法之前,需确保其他所有客户端操作均已完成。有关更多信息,请参阅 Client 类参考页中的注意事项。