【问题标题】:CAKE: There is no argument given that corresponds to the required formal parameterCAKE:没有给出与所需形式参数相对应的参数
【发布时间】:2017-09-22 20:04:23
【问题描述】:

我使用 CAKE 0.21.1.0。

这里是相关的sn-p代码:

var teamCityLoggerZipFolderPath = @".\TeamCity\CustomLogger\VSTest.TeamCityLogger.zip";
var dllDestinationFolder = @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions";

ZipAliases.Unzip(new FilePath(teamCityLoggerZipFolderPath), 
                 new DirectoryPath(dllDestinationFolder));

想法是解压文件夹并将其内容存储在dllDestinationFolder中。

但是,我一直看到此错误消息:

There is no argument given that corresponds to the required formal parameter 'outputPath' of 'ZipAliases.Unzip(ICakeContext, FilePath, DirectoryPath)'

据我所知,我正确地调用了FilePathDirectoryPath 构造函数,正如herehere 所记录的那样。我也不认为我在调用 ZipAliases.Unzip erroneously

我做错了什么?

【问题讨论】:

    标签: c# teamcity cakebuild


    【解决方案1】:

    解压缩可通过 DSL 作为全局方法或 ICakeContext 的扩展方法使用。

    因此您可以将其调用为UnzipContext.Unzip,例如:

    var teamCityLoggerZipFolderPath = @".\TeamCity\CustomLogger\VSTest.TeamCityLogger.zip";
    var dllDestinationFolder = @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions";
    
    Unzip(teamCityLoggerZipFolderPath, dllDestinationFolder);
    
    
    Context.Unzip(teamCityLoggerZipFolderPath, dllDestinationFolder);
    

    【讨论】:

    • 您好,感谢您的回复。我将其更改为Context.Unzip,但现在我看到了错误消息Error: One or more errors occurred.(我知道非常有用。)Unzip 也显示了相同的错误消息。
    • 尝试启动带有诊断详细信息的蛋糕。 stackoverflow.com/questions/38658660/…
    • 我更正了错误,您建议的更改现在可以正常工作了。
    • 对“发生一个或多个错误”消息进行排序非常好,这是一种回归,将在下一版本中排序以打印异常消息。
    • 很高兴听到这个消息。这是一个完全没用的错误信息,它让我热血沸腾......
    猜你喜欢
    • 2016-05-13
    • 1970-01-01
    • 2016-11-11
    • 2019-08-09
    • 1970-01-01
    • 2017-07-18
    • 2022-08-24
    • 2019-01-16
    • 1970-01-01
    相关资源
    最近更新 更多