msbuild
msbuild copied to clipboard
LogErrorFromException could preserve Exception.HelpLink
By the way, I assumed that LogErrorFromException would read Exception.HelpLink, but it doesn't seem to do that.
Originally posted by @KalleOlaviNiemitalo in https://github.com/dotnet/msbuild/issues/5493#issuecomment-1238926812
I'm trying to think of a downside here, and the worst I can think of is "a new not-very-helpful link is referenced", which doesn't seem too bad . . .
If this is implemented, then the same change should be made to LogWarningFromException.
.NET Runtime doesn't seem to have many components that set Exception.HelpLink.
- Microsoft.AspNetCore.Mvc.ModelBinding.Validation: Unlikely to be used in MSBuild task.
- Microsoft.VisualBasic.ErrObject: Quite possible, even in inline tasks.
- System.Windows.Interop (in WPF): Unlikely to be used in MSBuild task.
- System.Windows.Forms.Design: Unlikely to be used in MSBuild task.
- COM or WinRT interop: Perhaps.
System.Data.SqlClient and Microsoft.Data.SqlClient do not set Exception.HelpLink, but they add "HelpLink.BaseHelpUrl" etc. to Exception.Data of SqlException. I don't know what reads those; perhaps ConnectionDialog.
Does this mean we'd be slowly adding helplinks to most MSBuild errors? Presumably starting with the most popular ones.
Related to docs, cc @ghogen