msbuild
msbuild copied to clipboard
Logs an error with code extraction and details
Fixes #8785
Context
Re logging, the XslTransformation task calls TaskLoggingHelper.LogErrorWithCodeFromResources(string messageResourceName, params object[] messageArgs). There is also TaskLoggingHelper.LogErrorFromException(Exception exception, bool showStackTrace, bool showDetail, string file), which logs the inner exceptions if requested via the showDetail parameter or the "MSBUILDDIAGNOSTICS" environment variable, but this then does not log an error code
Changes Made
Add a new log method logErrorWithCodeAndException which Logs an error using a resource string (with code extraction and help keyword) and appends exception details.
Testing
XslDocumentFunctionWorks()
log output contains message and stack trace