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
dotnet (6.0.300) restore --verbosity Diagnostic causes MSB0001: Internal MSBuild Error #7622
Comments
|
To give some context, this is the repository that we build: https://dev.azure.com/mseng/Domino/_git/AnyBuild |
|
I repro on @narasamdya's (MSFT-internal) repo, only on Linux. It looks like there's a With that I can repro in WSL on a template classlib project: $ dotnet restore --verbosity Diagnostic -flp:v=diag "/ConsoleLoggerParameters:Verbosity=Minimal"
/usr/share/dotnet/sdk/6.0.300/MSBuild.dll -nologo -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/6.0.300/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/6.0.300/dotnet.dll -flp:v=diag -maxcpucount -target:Restore -verbosity:m -verbosity:diagnostic /ConsoleLoggerParameters:Verbosity=Minimal ./TemplateClasslib.csproj
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot have finished counter without started counter.
at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.MPPerformanceCounter.AddEventFinished(String projectTargetNames, BuildEventContext buildEventContext, DateTime eventTimeStamp)
at Microsoft.Build.BackEnd.Logging.ParallelConsoleLogger.StatusEventHandler(Object sender, BuildStatusEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseStatusEvent(Object sender, BuildStatusEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent, Int32 sinkId)
at Microsoft.Build.BackEnd.Logging.EventRedirectorToSink.Microsoft.Build.Framework.IEventRedirector.ForwardEvent(BuildEventArgs buildEvent)
at Microsoft.Build.Logging.ConfigurableForwardingLogger.ForwardToCentralLogger(BuildEventArgs e)
at Microsoft.Build.Logging.ConfigurableForwardingLogger.BuildStatusHandler(Object sender, BuildStatusEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseStatusEvent(Object sender, BuildStatusEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(BuildEventArgs eventArg)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent)
--- End of stack trace from previous location ---
at Microsoft.Build.Execution.BuildManager.EndBuild()
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache, String[] commandLine)
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot have finished counter without started counter.
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache, String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot have finished counter without started counter.
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache, String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
at Microsoft.DotNet.Cli.Utils.MSBuildForwardingAppWithoutLogging.ExecuteInProc(String[] arguments) |
|
With Visual Studio 2022 update 17.2.3 installed we get the same error when calling When we change to /v:d it works. it is 100% reproducible at our site. |
Specifying both diagnostic verbosity and minimal verbosity led to an internal exception on linux because the start/stop events were enabled independently but some codepaths assumed that if one existed the other did too. Fixes #7622
|
Similar to @robvdnieuw, I have version 17.2.1+52cd2da31 for .NET framework installed and I get a very similar stack trace when using the MSBuild Log Viewer with my project: So I'd glad to see an updated version with one of the next minor VS patches. |
We upgrade the sdk to 6.0.300, and when we ran
dotnet restore --verbosity Diagnostic, we got the following error:The text was updated successfully, but these errors were encountered: