[英]Nuget: script for removing a DLL reference in 'uninstall.ps1'
Somewhere in the mists of time I found an example of a Nuget uninstall.ps1 script to remove a DLL reference that I've been blindly copying ever since. 某处在时间的迷雾,我发现一个的NuGet uninstall.ps1脚本示例删除DLL的参考,我一直在盲目照搬至今。 This is it:
就是这个:
param($installPath, $toolsPath, $package, $project)
$project.Object.References.Remove("Dll.Name");
But now when invoking a package uninstall I'm getting an error saying that Remove is not a method. 但是现在调用软件包卸载时,我收到一条错误消息,指出“ 删除”不是一种方法。 What script should I be using to remove a DLL reference?
我应该使用哪个脚本来删除DLL参考?
It does not look like References has a Remove method. 看起来引用没有具有Remove方法。 You can use the following if you know the assembly name.
如果知道程序集名称,则可以使用以下内容。
$project.Object.References.Item("System.Xml.Linq").Remove()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.