msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

LogErrorFromException could preserve Exception.HelpLink

Open rainersigwald opened this issue 2 years ago • 4 comments

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

rainersigwald avatar Sep 07 '22 10:09 rainersigwald

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 . . .

rainersigwald avatar Sep 07 '22 10:09 rainersigwald

If this is implemented, then the same change should be made to LogWarningFromException.

KalleOlaviNiemitalo avatar Sep 07 '22 11:09 KalleOlaviNiemitalo

.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.

KalleOlaviNiemitalo avatar Sep 07 '22 11:09 KalleOlaviNiemitalo

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

benvillalobos avatar Sep 15 '22 17:09 benvillalobos