Documentation is the worst offender. I remember one time that running dotnet restore
and later running another command with --no-restore
flag wouldn’t work, but running the last command without the --no-restore
flag would. Creating a sane CI/CD pipeline for C# apps is a PITA.
I’ve never had an issue with the dotnet CLI, including the commands you’re talking about. Their documentation is a bit scattered at times but for the most part they have examples on everything and walk through most scenarios.
I’m not a Microsoft employee either, just a c# dev of 10 years.
I do a lot of work with c# CI/CD and doing what you said absolutely does work.
Most of my scripts are
dotnet restore
dotnet build --no-restore
dotnet test --no-build
dotnet publish --no-build