Prerequisites
Cake runner
Cake Frosting
Cake version
5.0.0
Operating system
Windows
Operating system architecture
x64
CI Server
No response
What are you seeing?
When specifying the Verbosity property on the DotNetMsbuildSettings class the dotnet msbuild tool outputs an error:
MSBUILD : error MSB1016: Specify the verbosity level.
Full command line: 'C:\Program Files\dotnet\sdk\8.0.404\MSBuild.dll -maxcpucount -verbosity:m test.proj --verbosity detailed -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll'
What is expected?
The dotnet msbuild command should not include the --verbosity detailed that is included with most of the other DotNet* aliases.
Steps to Reproduce
test.proj
<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name="Echo">
<Message Importance="high" Text="High Message" />
<Message Importance="normal" Text="Normal Message" />
<Message Importance="low" Text="Low Message" />
</Target>
</Project>
Program.cs
using Cake.Common.Tools.DotNet;
using Cake.Common.Tools.DotNet.MSBuild;
using Cake.Core;
using Cake.Frosting;
public static class Program
{
public static int Main(string[] args)
{
return new CakeHost()
.Run(args);
}
}
[TaskName("Hello")]
public sealed class HelloTask : FrostingTask
{
public override void Run(ICakeContext context)
{
context.DotNetMSBuild("test.proj", new DotNetMSBuildSettings()
{
Verbosity = DotNetVerbosity.Detailed
});
}
}
build.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="5.0.0" />
</ItemGroup>
</Project>
Then run:
dotnet run --project .\build.csproj --target Hello
Output log
C:\Program Files\dotnet\sdk\8.0.404\MSBuild.dll -nologo -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll -maxcpucount -restore -verbosity:m -verbosity:diagnostic .\Build.csproj
Build started 1/30/2025 11:08:11.
Environment at start of build:
MSBuildSDKsPath = C:\Program Files\dotnet\sdk\8.0.404\Sdks
MSBUILDUSESERVER = 0
MSBuildLoadMicrosoftTargetsReadOnly = true
MSBUILDFAILONDRIVEENUMERATINGWILDCARD = 1
DOTNET_CLI_TELEMETRY_SESSIONID = 99d966f0-a5f3-4ce3-b75e-d7afa6a04644
DOTNET_HOST_PATH = C:\Program Files\dotnet\dotnet.exe
MSBuildExtensionsPath = C:\Program Files\dotnet\sdk\8.0.404\
11:08:11.436 0>Process = "C:\Program Files\dotnet\dotnet.exe"
MSBuild executable path = "C:\Program Files\dotnet\sdk\8.0.404\MSBuild.dll"
Command line arguments = "C:\Program Files\dotnet\sdk\8.0.404\MSBuild.dll -maxcpucount -verbosity:m -nologo -restore .\Build.csproj -nologo -verbosity:diagnostic -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll"
MSBuild version = "17.11.9+a69bbaaf5"
Based on the Windows registry key LongPathsEnabled, the LongPaths feature is enabled.
//
// snip - bunch of msbuild output...
//
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.93
========================================
Hello
========================================
MSBuild version 17.11.9+a69bbaaf5 for .NET
MSBUILD : error MSB1016: Specify the verbosity level.
Full command line: 'C:\Program Files\dotnet\sdk\8.0.404\MSBuild.dll -maxcpucount -verbosity:m test.proj --verbosity detailed -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.404\dotnet.dll'
Switches appended by response files:
Switch: --verbosity
For switch syntax, type "MSBuild -help"
An error occurred when executing task 'Hello'.
Error: .NET CLI: Process returned an error (exit code 1).
Prerequisites
Cake runner
Cake Frosting
Cake version
5.0.0
Operating system
Windows
Operating system architecture
x64
CI Server
No response
What are you seeing?
When specifying the
Verbosityproperty on theDotNetMsbuildSettingsclass the dotnet msbuild tool outputs an error:What is expected?
The
dotnet msbuildcommand should not include the--verbosity detailedthat is included with most of the other DotNet* aliases.Steps to Reproduce
test.proj
Program.cs
build.csproj
Then run:
Output log