Home > Enterprise >  How do I find where I am using stackalloc in loops? (Troubleshooting CA2014 and code analyzer)
How do I find where I am using stackalloc in loops? (Troubleshooting CA2014 and code analyzer)

Time:04-22

Microsot.CodeAnalysis.Charp.NetAnalyzers tells me

CA2014 Do not use stackalloc in loops

with the yellow triangle icon.

Yellow triangle

How do I find what code in my project is doing this? There are no errors or warnings or messages when I build.

I found something in the docs more information

Including a link to docs

I have searched my code for "stackalloc" but I am not using it.

CodePudding user response:

I just opened another of my projects which looks more like yours. When I tried to investigate, I found the possible confusion: The icon next to the rule (info, warning, error) does not mean that there are errors or warnings from that rule, but that the rule level is set to warning or error respectively (you can change this by right-clicking on the rule). If you where to introduce some code that would trigger that warning, you should see it in the list of the compilation errors.

  • Related