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.

Error while analyzing build - System.InvalidCastException: Unable to cast object of type 'Microsoft.Build.Logging.StructuredLogger.Folder' to type 'Microsoft.Build.Logging.StructuredLogger.Project'.

See original GitHub issue
Error while analyzing build. Sorry about that. Please Ctrl+C to copy this text and file an issue on https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/new 

System.InvalidCastException: Unable to cast object of type 'Microsoft.Build.Logging.StructuredLogger.Folder' to type 'Microsoft.Build.Logging.StructuredLogger.Project'.

   at Microsoft.Build.Logging.StructuredLogger.ImportTreeAnalyzer.AddImport(Message message, String project, String importedProject, Int32 line, Int32 column, Boolean imported, String reason)
   at Microsoft.Build.Logging.StructuredLogger.ImportTreeAnalyzer.VisitMessage(Message message, StringCache stringTable)
   at Microsoft.Build.Logging.StructuredLogger.TreeNode.VisitAllChildren[T](Action`1 processor, CancellationToken cancellationToken, Boolean takeChildrenSnapshot)
   at Microsoft.Build.Logging.StructuredLogger.TreeNode.VisitAllChildren[T](Action`1 processor, CancellationToken cancellationToken, Boolean takeChildrenSnapshot)
   at Microsoft.Build.Logging.StructuredLogger.ImportTreeAnalyzer.Analyze(Folder evaluation, StringCache stringTable)
   at Microsoft.Build.Logging.StructuredLogger.BuildAnalyzer.ProcessBeforeChildrenVisited(TreeNode node)
   at Microsoft.Build.Logging.StructuredLogger.BuildAnalyzer.Visit(TreeNode node)
   at Microsoft.Build.Logging.StructuredLogger.BuildAnalyzer.Visit(TreeNode node)
   at Microsoft.Build.Logging.StructuredLogger.BuildAnalyzer.Analyze()
   at Microsoft.Build.Logging.StructuredLogger.BuildAnalyzer.AnalyzeBuild(Build build)


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
KirillOsenkovcommented, Oct 22, 2018

Thanks to Paulo’s log I have now pushed an even better fix! Found the real problem and solved it. Details here: https://github.com/KirillOsenkov/MSBuildStructuredLog/commit/bd4d73b5116d09fdaf2b90e31a5e08668634281f

1reaction
daveaglickcommented, Oct 22, 2018

YOLO fixes are best fixes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build project got the error "unable to cast object of type..."
How to fix that problem? According to the error message, it seems the Visual Studio setting of NuGet package managment have been corrupted....
Read more >
Exception : Unable to cast object of type 'Microsoft. ...
MSBuildWorkspace: Exception : Unable to cast object of type 'Microsoft.CodeAnalysis.BuildTasks.Csc' to type 'Microsoft.Build.Framework.ITask'. #24691.
Read more >
Microsoft.Build.Logging Namespace
A logger that serializes all incoming BuildEventArgs in a compressed binary file (*.binlog). The file can later be played back and piped into...
Read more >
System.InvalidCastException: Unable to cast object of type ...
Hi, In my Blazor server application, I am trying to get the records from ... InvalidCastException: Unable to cast object of type 'System....
Read more >
MSBUILD : error MSB1025: An internal failure occurred ...
we have restore package task in our pipeline and it is failing intermittently with the outofmemory exception. Please find below logs :
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