【问题标题】:Cake Build Suppress MSBuild WarningsCake Build 抑制 MSBuild 警告
【发布时间】:2018-11-03 23:14:49
【问题描述】:

我正在尝试使用 cake 构建文件构建我的 .net 解决方案。我正在尝试使用网站上的文档here

我当前的 msbuild 任务如下所示:

MSBuild("./solution.sln", new MSBuildSettings()
        .SetConfiguration(environmentSetting)
        .SetMSBuildPlatform(MSBuildPlatform.Automatic)
        .SetVerbosity(Verbosity.Minimal)
        .SetMaxCpuCount(System.Environment.ProcessorCount)
        .SetNodeReuse(false)
        .WithConsoleLoggerParameter("ErrorsOnly"));

参数.WithConsoleLoggerParameter一直报错。我不确定我在这里做错了什么。

Microsoft 文档显示 here 相同的东西,我尝试在 powershell 中使用相同的参数运行它,它只运行文件。

【问题讨论】:

    标签: msbuild roslyn msbuild-task cakebuild msbuildcommunitytasks


    【解决方案1】:

    其实我想通了。我不确定参数自定义是如何工作的,所以对此的任何解释都会很棒!

    我把代码改成

    MSBuild("./solution.sln", new MSBuildSettings(){
         ArgumentCustomization = args=>args.Append("/consoleloggerparameters:ErrorsOnly") 
     }
        .SetConfiguration(environmentSetting)
        .SetMSBuildPlatform(MSBuildPlatform.Automatic)
        .SetVerbosity(Verbosity.Minimal)
        .SetMaxCpuCount(System.Environment.ProcessorCount)
        .SetNodeReuse(false));
    

    似乎有效。希望这对某人有帮助!

    【讨论】:

      猜你喜欢
      • 2010-11-04
      • 2011-01-26
      • 2011-01-04
      • 2019-02-11
      • 2021-03-31
      • 1970-01-01
      • 2011-03-31
      • 2019-10-22
      • 2014-12-19
      相关资源
      最近更新 更多