dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.15k stars 1.34k forks source link

ProjectEvaluationFinished event is not sent if there was an error during evaluation #10113

Open KirillOsenkov opened 3 weeks ago

KirillOsenkov commented 3 weeks ago

If there was an error during evaluation, such as unable to resolve SDK, ProjectEvaluationFinishedEventArgs isn't sent, and so we don't get any properties and items from that evaluation.

Sample error: C:\Users\WDAGUtilityAccount\AppData\Local\Microsoft\Components\MSBuild\MSBuild\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,3): Could not resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK. Unable to locate the .NET SDK. Check that it is installed, your PATH is configured for the correct architecture, and that the version specified in global.json (if any) matches the installed version. The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json. MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator" because directory "C:\Users\WDAGUtilityAccount\AppData\Local\Microsoft\Components\MSBuild\MSBuild\Sdks\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk" did not exist.