Open JeroenOortwijn opened 11 months ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
The same problem exists with dotnet build --tl on
which fails the same way.
Also the docs only describe this option for dotnet build
, but it seems to work for dotnet publish
as well, so might be worth updating.
Short-term workaround: use the --tl=<on|off|auto>
format - replacing the space between the option and the arg with an equals sign. That should always work. We'll look into what's happening in the CLI and see if docs updates need to happen.
re: @vitek-karas - it's available for any command that delegates to MSBuild under the covers, so we probably need to do more thorough documentation:
definitely support it, but there may be one or two more I'm forgetting.
This is 'just' a doc bug. What we're doing here is just letting the dotnet
CLI pass through to MSBuild, so you have to use the MSBuild
syntax. I'll send a PR to the docs for now. For 8.0.200 we should make a proper .NET CLI option so that usres have the nicer syntax.
Logged https://github.com/dotnet/docs/issues/38259 to track the docs updates.
I filed a request back before the repos split with runtime/sdk (I think, if my memory is correct) requesting that the CLI build in a way to export every command and description to a json output. The Azure CLI did this and it was extremely easy to use that JSON to automate docs, do diffs to find differences, etc.
Should I file another request?
Yes please - that's directly aligned with something that I was discussing with @MiYanni yesterday.
Short-term workaround: use the
--tl=<on|off|auto>
format - replacing the space between the option and the arg with an equals sign. That should always work. We'll look into what's happening in the CLI and see if docs updates need to happen.
Unfortunately that doesn't work either:
C:\Users\Jeroen\Downloads\Test>dotnet publish --tl=on
MSBuild version 17.8.3+195e7f5a3 for .NET
MSBUILD : error MSB1001: Unknown switch.
Full command line: 'C:\Program Files\dotnet\sdk\8.0.100\MSBuild.dll -maxcpucount -verbosity:m -restore -target:Publish --property:_IsPublishing=true -property:Configuration=Release --tl=on -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.100\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.100\dotnet.dll'
Switches appended by response files:
Switch: --tl=on
For switch syntax, type "MSBuild -help"
This is 'just' a doc bug. What we're doing here is just letting the
dotnet
CLI pass through to MSBuild, so you have to use theMSBuild
syntax. I'll send a PR to the docs for now. For 8.0.200 we should make a proper .NET CLI option so that usres have the nicer syntax.
I don't think it's just a documentation bug, because the --configuration
switch does work correctly:
C:\Users\Jeroen\Downloads\Test>dotnet publish --configuration Debug
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
Test -> C:\Users\Jeroen\Downloads\Test\bin\Debug\net8.0\Test.dll
Test -> C:\Users\Jeroen\Downloads\Test\bin\Debug\net8.0\publish\
Short-term workaround: use the
--tl=<on|off|auto>
format - replacing the space between the option and the arg with an equals sign. That should always work. We'll look into what's happening in the CLI and see if docs updates need to happen.Unfortunately that doesn't work either:
C:\Users\Jeroen\Downloads\Test>dotnet publish --tl=on MSBuild version 17.8.3+195e7f5a3 for .NET MSBUILD : error MSB1001: Unknown switch. Full command line: 'C:\Program Files\dotnet\sdk\8.0.100\MSBuild.dll -maxcpucount -verbosity:m -restore -target:Publish --property:_IsPublishing=true -property:Configuration=Release --tl=on -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.100\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.100\dotnet.dll' Switches appended by response files: Switch: --tl=on For switch syntax, type "MSBuild -help"
Looking through the code, I found a working solution:
C:\Users\Jeroen\Downloads\Test>dotnet publish -tlp:default=on
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,2s) → bin\Release\net8.0\publish\
Build succeeded in 0,8s
C:\Users\Jeroen\Downloads\Test>dotnet publish -tlp:default=off
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\Test.dll
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\publish\
C:\Users\Jeroen\Downloads\Test>dotnet publish -tlp:default=auto
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,2s) → bin\Release\net8.0\publish\
Build succeeded in 0,9s
Another working solution (from: https://github.com/dotnet/msbuild/issues/9150):
C:\Users\Jeroen\Downloads\Test>dotnet publish -tl:on
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,2s) → bin\Release\net8.0\publish\
Build succeeded in 0,9s
C:\Users\Jeroen\Downloads\Test>dotnet publish -tl:off
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\Test.dll
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\publish\
C:\Users\Jeroen\Downloads\Test>dotnet publish -tl:auto
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,3s) → bin\Release\net8.0\publish\
Build succeeded in 0,9s
And --tl
then also works:
C:\Users\Jeroen\Downloads\Test>dotnet publish --tl:on
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,2s) → bin\Release\net8.0\publish\
Build succeeded in 0,9s
C:\Users\Jeroen\Downloads\Test>dotnet publish --tl:off
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\Test.dll
Test -> C:\Users\Jeroen\Downloads\Test\bin\Release\net8.0\publish\
C:\Users\Jeroen\Downloads\Test>dotnet publish --tl:auto
MSBuild version 17.8.3+195e7f5a3 for .NET
Restore complete (0,4s)
Test succeeded (0,2s) → bin\Release\net8.0\publish\
Build succeeded in 0,9s
Description
According to https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build,
dotnet publish --tl on
should build a .Net 8 project with terminal logging enabled.Reproduction Steps
dotnet new console
.dotnet publish --tl
.dotnet publish --tl on
.Expected behavior
Every step succeeds.
Actual behavior
dotnet publish --tl on
fails withMSBUILD : error MSB1009: Project file does not exist.
:Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response