dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.71k stars 3.98k forks source link

MSB4181 with task cancelled warning #49738

Open Forgind opened 3 years ago

Forgind commented 3 years ago

If you cancel the build during the csc task, it returns false and logs MSB5021, a warning. This triggers MSB4181, a task returned false but did not log an error. It probably shouldn't. To reproduce, build a C# project that will compile for a long time, cancel the build partway through, and observe your errors.

Forgind commented 3 years ago
Attempting to cancel the build...
C:\Users\forgind\Documents\GitHub\msbuild\artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.C
ore.targets(59,5): warning MSB5021: Terminating the task executable "csc" and its child processes because the build was
 canceled. [C:\Users\forgind\Documents\GitHub\OrchardCore\src\OrchardCore.Modules\OrchardCore.Workflows\OrchardCore.Wo
rkflows.csproj]
C:\Users\forgind\Documents\GitHub\msbuild\artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.C
ore.targets(59,5): error MSB4181: The "Csc" task returned false but did not log an error. [C:\Users\forgind\Documents\
GitHub\OrchardCore\src\OrchardCore.Modules\OrchardCore.Workflows\OrchardCore.Workflows.csproj]
benvillalobos commented 3 years ago

MSBuild Team Triage: We should consider upgrading the warning in ManagedCompiler that a task was cancelled to an error. Moving to Roslyn.