# Getting warning: Add the 'const' modifier to

**URL:** <https://community.sonarsource.com/t/getting-warning-add-the-const-modifier-to/135512>\
**Category:** Visual Studio\
**Created:** [February 19, 2025, 3:06pm UTC](https://community.sonarsource.com/t/getting-warning-add-the-const-modifier-to/135512 "2025-02-19T15:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darren\_McDaniel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/darren_mcdaniel/32/65694_2.png) [@Darren\_McDaniel](https://community.sonarsource.com/u/Darren_McDaniel)\
**Post date:** [February 19, 2025, 3:06pm UTC](https://community.sonarsource.com/t/getting-warning-add-the-const-modifier-to/135512/1 "2025-02-19T15:06:23Z")

</div>

Please provide

- Operating system: Windows 11
- Visual Studio version: 17.12.5
- SonarQube for Visual Studio plugin version: 8.11.0.11944
- Programming language you’re coding in: c#
- Is connected mode used:
  - SonarQube Server : \* Enterprise Edition

- v2025.1 (102418)

And a thorough description of the problem / question: Started getting these warnings in the IDE that really shouldnt be popping up IMHO…

 ![{758FEFF4-84E8-40C8-AFF2-8B63F96E4B6B}](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/1/a1be2adabdd37a732edf9cbf186310c236c1a409.png)  
example:  
 ![{F9DC0248-A2D4-44A0-AB65-71B8C53E9B59}](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/8/2/829a698587263335035d45343a20cc0405752683.png)

---

<div class="post-metadata">

**Author:** ![Corniel](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/corniel/32/10101_2.png) [@Corniel](https://community.sonarsource.com/u/Corniel)\
**Post date:** [February 19, 2025, 4:56pm UTC](https://community.sonarsource.com/t/getting-warning-add-the-const-modifier-to/135512/2 "2025-02-19T16:56:05Z")

</div>

Can you explain why this is a false positive? And also add the tag C# or dotnet to it?

---

<div class="post-metadata">

**Author:** ![shmowzow](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@shmowzow](https://community.sonarsource.com/u/shmowzow)\
**Post date:** [April 14, 2025, 12:36pm UTC](https://community.sonarsource.com/t/getting-warning-add-the-const-modifier-to/135512/3 "2025-04-14T12:36:13Z")

</div>

Hey o/

Did you find a solution? I tried to remove bin and obj folders but no change. My friend doesn’t have this but I can see errors.
