KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.44k stars 191 forks source link

Unexpected exception. Sorry about that. #527

Closed n9 closed 3 years ago

n9 commented 3 years ago

Just trying: https://github.com/KirillOsenkov/MSBuildStructuredLog/releases/tag/v2.1.557


Unexpected exception. Sorry about that.

Please Ctrl+C to copy this text and file an issue at https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/new

System.ArgumentNullException: Value cannot be null.
Parameter name: fileName
   at System.IO.FileInfo..ctor(String fileName)
   at Microsoft.Build.Logging.StructuredLogger.BinlogStats.Calculate(String binlogFilePath) in C:\projects\msbuildstructuredlog\src\StructuredLogger\Analyzers\Stats.cs:line 14
   at StructuredLogViewer.Controls.BuildControl.DisplayStats() in C:\projects\msbuildstructuredlog\src\StructuredLogViewer\Controls\BuildControl.xaml.cs:line 1712
   at StructuredLogViewer.MainWindow.Stats_Click(Object sender, RoutedEventArgs e) in C:\projects\msbuildstructuredlog\src\StructuredLogViewer\MainWindow.xaml.cs:line 735
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
n9 commented 3 years ago

Maybe it is caused by: Exception occurred during build:

System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at StructuredLogViewer.HostedBuild.<>c__DisplayClass6_0.<BuildAndGetResult>b__0() in C:\projects\msbuildstructuredlog\src\StructuredLogViewer.Core\HostedBuild.cs:line 52

But %localappdata%\Microsoft\MSBuildStructuredLog\LoggerExceptions.txt does not exist.

KirillOsenkov commented 3 years ago

So is this fixed? Or is there still a problem?

n9 commented 3 years ago

@KirillOsenkov I think it is not fixed. The fix is for https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/527#issuecomment-904631005. I think the issue is currently about app crash if a build crashes. (I just solved one reason for the build crash.)

KirillOsenkov commented 3 years ago

I've just fixed another problem where displaying Statistics crashes if the log file isn't found. This is your first callstack above. https://github.com/KirillOsenkov/MSBuildStructuredLog/commit/14b3beb3a7b85c092ccabfbe4f4ecf48bb8234ff

KirillOsenkov commented 3 years ago

I think both of our fixes together will fix it. I'll close this one but please feel free to open a new bug if something else is broken. Thanks!