-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: [DotNetCoreCLIv2]: opt-in the MSBuild logger to new IEventSource4
#19387
Comments
IEventSource4
While we're updating the logger we should also fix #16366 |
#16301 is also related |
In general, the MSBuild logger is poorly written, unnecessarily complicated, buggy and should be rewritten from scratch. It should look something like this: Perhaps we could even repurpose the MSBuild built-in SimpleErrorLogger to output AzureDevOps-specific outputs. Observations from reviewing the current (legacy) logger:
The logger literally logs three types of strings:
It tries to be smart and use the logdetail feature for nesting projects, but is this even supported at all? I've never seen this in action? Does anyone have any screenshots? Even if we still need to support this, there should be a much easier way to achieve nesting, although my inclination would be to not do it at all and just do a flat list of errors and/or warnings. In fact I just wrote a logger from scratch that does all that: Perhaps just ship this logger instead of the current one. Here's how to use it:
|
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
this still needs fixing |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
this still needs fixing |
New issue checklist
Task name
DotNetCoreCLI
Task version
2
Issue Description
DotNetCoreCLIV2
uses an MSBuild logger namedMicrosoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll
.The source of the logger can be found in repo
microsoft/azure-pipelines-msbuild-logger
.The binary of the logger is referenced here:
azure-pipelines-tasks/Tasks/DotNetCoreCLIV2/make.json
Line 5 in cccb1c6
and here:
azure-pipelines-tasks/Tasks/DotNetCoreCLIV2/dotnetcore.ts
Lines 111 to 114 in 6b291c4
The logger is legacy and doesn't support some newer MSBuild features. Specifically, when this logger is added to MSBuild, MSBuild loses the ability to log all properties and items on
ProjectEvaluationFinishedEventArgs
. This is a severe impediment for everyone who is using MSBuild binlogs recorded by Azure DevOps.The logger needs to be updated to opt-in to the newer features. It is currently referencing a super old version of
Microsoft.Build.Framework.dll
. We need to determine what is the minimum supported version of MSBuild that this task runs with, and reference the corresponding version of Microsoft.Build.Framework NuGet package. I recommend 17.5.0:https://www.nuget.org/packages/Microsoft.Build.Framework/17.5.0
After the new MSBuild is referenced by the logger project, you need to add this to the Initialize() method of the Logger class:
https://github.com/dotnet/sdk/blob/91a440681da35b13a1528bd6dcf35c64a2c221ab/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingLogger.cs#L20-L25
I'd be happy to code review this work. This needs to be done because I'm seeing many binlogs submitted by customers which are missing this important information and it's not obvious that it's missing and there are no instructions on how to fix this.
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows 10
Relevant log output
Full task logs with system.debug enabled
N/A
Repro steps
N/A
The text was updated successfully, but these errors were encountered: