Hi, I have a page where I have some components with a reference to a backfield.
@ref="_areaChart"
and in my code I have private ApexChart<ChartData>? _areaChart
Yet anytime I build, clean, rebuild, close Visual Studio and rebuild, the compiler tells me I don’t use the _areaChart field and it should be removed.
See the screenshot of my code below :
error S4487: Remove this unread private field ‘_areaChart’ or refactor the code to use its value. (C# static code analysis)
Is it a bug of SonarSource or Visual Studio ?
Right now, I have a fake method that use the private field just to trick the sonarsource.
(_areaChart = _areaChart;)
- Operating system: Windows 11
- IDE name and flavor/env: Visual Studio 2022 17.14
Might be linked to There is an issue with csharpsquid:S1144 (unused code detection) with razor pages - SonarQube for IDE / IntelliJ Platform - Sonar Community