Skip to content
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

SA1201 throws KeyNotFoundException #3270

Closed
alexanderyaremchuk opened this issue Dec 9, 2020 · 3 comments
Closed

SA1201 throws KeyNotFoundException #3270

alexanderyaremchuk opened this issue Dec 9, 2020 · 3 comments
Labels

Comments

@alexanderyaremchuk
Copy link

Any ideas wat could be the cause and remedy for this?:
Error AD0001 Analyzer 'StyleCop.Analyzers.OrderingRules.SA1201ElementsMustAppearInTheCorrectOrder' threw an exception of type 'System.Collections.Generic.KeyNotFoundException' with message 'The given key was not present in the dictionary.'

@sharwell
Copy link
Member

sharwell commented Dec 9, 2020

What version of StyleCop Analyzers are you using?

If you build with /v:diag, it should provide a stack trace and context information for the code it was analyzing at the time of the exception. Can you include that information here?

@alexanderyaremchuk
Copy link
Author

alexanderyaremchuk commented Dec 10, 2020

v. 1.1.118.
The trace output after building with /v:diag doesn't seem to reveal anything other than

(CoreCompile target) ->CSC : error AD0001: Analyzer 'StyleCop.Analyzers.OrderingRules.SA1201ElementsMustAppearInTheCorrectOrder' threw an exception of type 'System.Collections.Generic.KeyNotFoundException' with message 'The given key 'RecordDeclaration' was not present in the dictionary.' <path/to/my/project>.

It seems to be related to using record types

@sharwell
Copy link
Member

This issue was fixed by #3264 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants