我已经在同一台机器上执行了很多次这样的项目,但由于某些原因,以下内容对我不起作用:
Install-CleanReferencesTarget
(从https://github.com/Fody/Costura复制/粘贴)当我到达第三步(总是一直工作到现在为止)时,我收到以下错误:
PM> Install-CleanReferencesTarget
Install-CleanReferencesTarget : The term 'Install-CleanReferencesTarget' is not recognized
as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Install-CleanReferencesTarget
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-CleanReferencesTarget:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我尝试重新创建项目,重新启动我的电脑,重新启动VS,以管理员身份运行VS等,但结果相同。我还验证了有问题的DLL(FileHelpers.dll)设置为复制本地。
我还查看了另一个包含相同DLL的项目中的FodyWeavers.xml
文件,并且没有这个问题,并且它与这个麻烦项目中的文件相同:
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<Costura/>
</Weavers>
有谁知道为什么会突然发生这种情况?
答案 0 :(得分:2)
根据latest doc,它似乎已在较新版本中删除,这将自动启用该功能。可以通过更改Costura配置文件来禁用清理。
DisableCleanup
作为Costura的一部分,嵌入式组件不再包含在内 构建。可以关闭此清理。
默认为
false
<Costura DisableCleanup='true' />
有关配置选项的详细信息,另请参阅this post。
答案 1 :(得分:1)
答案 2 :(得分:0)
不是这样的答案,但我遇到了同样的问题,并设法找到了解决办法。
最后,我将目标添加到here底部的proj文件中,而不是使用cmdlet。这似乎有效。