question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException when creating log from app

See original GitHub issue

If I open a solution and run it directly from the app, the resulting log file is full of the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.Logging.StructuredLogger.ItemGroupParser.ParsePropertyOrItemList(String message, String prefix, StringCache stringTable) in C:\MSBuildStructuredLog\src\StructuredLogger\Construction\ItemGroupParser.cs:line 30
   at Microsoft.Build.Logging.StructuredLogger.MessageProcessor.AddItemGroup(BuildMessageEventArgs args, String prefix, NamedNode containerNode) in C:\MSBuildStructuredLog\src\StructuredLogger\Construction\MessageProcessor.cs:line 154
   at Microsoft.Build.Logging.StructuredLogger.MessageProcessor.Process(BuildMessageEventArgs args) in C:\MSBuildStructuredLog\src\StructuredLogger\Construction\MessageProcessor.cs:line 46
   at Microsoft.Build.Logging.StructuredLogger.Construction.MessageRaised(Object sender, BuildMessageEventArgs args) in C:\MSBuildStructuredLog\src\StructuredLogger\Construction\Construction.cs:line 345

If I use the Build Logging window from inside VS, the resulting log files from the same project appear to be fine.

logs.zip

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
KirillOsenkovcommented, Jan 4, 2018

Pushed a new release. Thanks for investigating this!

0reactions
bordingcommented, Jan 4, 2018

Oh, this is because the exception actually happens inside MSBuild! It’s a different process.

Oh, of course. ItemGroupParser is part of the logger, so that would explain why I wasn’t hitting a breakpoint when opening the log. That would also explain why the binlog from VS didn’t have the problem either.

Could you try with f743ef5 and see if it goes away?

That appears to have fixed it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null reference exception in exception logging masking true ...
Exceptions in multithreaded application. 3 · Mutex could not be created. ASP.NET · 1 · Why ApplicationException is thrown? 6 · Exception ......
Read more >
Object Reference Not Set to an Instance of an Object
NullReferenceException errors are responsible for a good percentage of all ... log viewer, and Prefix is now a native application for Windows and...
Read more >
NullReferenceException Class (System)
Recording the bad data in a log file or in the application UI might be all you have to do. You can recover...
Read more >
Debugging System.NullReferenceException - elmah.io Blog
Logging and monitoring for null reference exceptions are a must. While some developers tempt to create control flow from exceptions (no-one ...
Read more >
NullReferenceException in ApplicationInsightsLogger.Log ...
Log when exception contains a Data entry with a null value #1436 ... AggregateException: An error occurred while writing to logger(s).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found