msbuild
msbuild copied to clipboard
Consider updating LogErrorFromException to take into account AggregateExceptions
The TaskLoggingHelper.LogErrorFromException() method should probably take into account an AggregateException and call itself multiple times for each inner exception.
https://github.com/dotnet/msbuild/blob/cc3db358d34ad4cd1ec0c67e17582d7ca2a15040/src/Shared/TaskLoggingHelper.cs#L920
It could also take into account special exceptions like InvalidProjectFileException which have project file information.
Here's what we did in NuGet to get a better experience when MSBuild APIs throw exceptions:
https://github.com/NuGet/NuGet.Client/pull/4809/files#diff-a1e0e948fb5d1439e0368357d8587e83fafe5d5bb1a4f3fad40b040b3b9bf022R1042-R1073
Yeah, we should definitely help here.
Originally suggested by @AArnott