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.

InvalidOperationException during build

See original GitHub issue

Description

In some of my projects I get the following error when building:

CSC : warning AD0001: Analyzer 'FluentAssertions.Analyzers.CollectionShouldHaveCountAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'This operation does not apply to an empty instance.'.

My guess is that the following IsEmpty check should happen before Peek(): https://github.com/fluentassertions/fluentassertions.analyzers/blob/686a33bb1cd40ea01fffeea8d4ef85e481271d32/src/FluentAssertions.Analyzers/Utilities/FluentAssertionsCSharpSyntaxVisitor.cs#L74-L78

If you need me to provide more information, let me know how and I will see what I can do.

Versions

  • FluentAssertions.Analyzers 0.11.3
  • .NET Framework 4.6.1

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
csoltenborncommented, May 28, 2023

Sorry, can’t comment on that - I moved on to different things…

Meir Blachman @.***> schrieb am So., 28. Mai 2023, 04:18:

@csoltenborn https://github.com/csoltenborn is this still an issue?

— Reply to this email directly, view it on GitHub https://github.com/fluentassertions/fluentassertions.analyzers/issues/78#issuecomment-1565686856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWCQDYMQDV6LZOIYAKJFTXIJVUDANCNFSM4FQGJHEQ . You are receiving this because you were mentioned.Message ID: @.*** com>

0reactions
Meir017commented, May 27, 2023

@csoltenborn is this still an issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

InvalidOperationException Class (System)
InvalidOperationException is used in cases when the failure to invoke a method is caused by reasons other than invalid arguments.
Read more >
InvalidOperationException during dotnet/aspnetcore CI build
Special callout that this was ARM64. The log file referred to in the error message doesn't have much more info in it: UNHANDLED...
Read more >
System.invalidOperationException While trying to update a ...
I'm having a problem with Entity Framework while trying to update a specific record The error message says "The property 'ID' is a...
Read more >
InvalidOperationException: The build target does not ...
I think I recently changed something, but I can't find what. This comes from the Oculus Ctrl+K command. Also on the Oculus Menu...
Read more >
InvalidOperationException in build only, when trying to ...
( Scene1 and Scene2 are const string s.) The program works fine when running in the Unity editor. However, when I make a...
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