# Error converting value "common-c:DuplicatedBlocks" to type 'System.Collections.Generic.Dictionary\`

**URL:** <https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335>\
**Category:** Visual Studio\
**Tags:** cfamily\
**Created:** [January 25, 2023, 6:54am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335 "2023-01-25T06:54:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [January 25, 2023, 6:54am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/1 "2023-01-25T06:54:41Z")

</div>

I’m using sonarlint extension in visual studio to analyze my C project locally, and i have defined rules set in settings.json . Rules set which are having numbers in it are analyzed properly, but rules which have string in it (ex:“common-c:DuplicatedBlocks”) is giving error like

**Error message: Error converting value “common-c:DuplicatedBlocks” to type ‘System.Collections.Generic.Dictionary`2[System.String,SonarLint.VisualStudio.Core.RuleConfig]’. Path ‘[‘sonarlint.rules’]’, line 3, position 30.**  
**Default settings will be used**

How to fix this error

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 26, 2023, 2:39pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/2 "2023-01-26T14:39:42Z")

</div>

Hi,

What are your Visual Studio and SonarLint versions?

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [January 26, 2023, 2:53pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/3 "2023-01-26T14:53:40Z")

</div>

Hi,

That error was caused by json format in settings.json file and it got solved

I’m using Sonarlint version: 6.12.0.59751 in visual studio 2019 professional edition, C rules which are having string in it or not considered as issue while analysing even though it’s mentioned in settings.json file

What configuration change do I need to make ,in order to consider all sonarqube rules in sonarlint analysis

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 26, 2023, 3:07pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/4 "2023-01-26T15:07:41Z")

</div>

Hi,

You’ll need to:

- set up a SonarQube/SonarCloud Quality Profile which includes all rules
- apply that profile to your project
- connect SonarLint to your project in SonarQube/SonarCloud.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [January 26, 2023, 3:20pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/5 "2023-01-26T15:20:23Z")

</div>

Hi,

I have made a sonarqube server setup also.  
Even with that connection not all the issues which are reported by sonarqube are appearing in visual studio  
Only limited issues are reported with sonarlint

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 26, 2023, 3:23pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/6 "2023-01-26T15:23:10Z")

</div>

Hi,

The [FAQ](https://community.sonarsource.com/t/frequently-asked-questions/7204) should help.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [January 27, 2023, 5:29am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/8 "2023-01-27T05:29:26Z")

</div>

Hi Ann,

Thanks for the input  
In FAQ it’s mentioned that rules starting with common won’t be considered as issue, but other rules like **c:CommentedCode, c:PPUndefUsage and c:SwitchWithoutDefault** are also not getting reported by sonarlint

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [January 27, 2023, 1:26pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/9 "2023-01-27T13:26:21Z")

</div>

Hi,

Yes, that’s in the FAQ. Sorry I flubbed the link before. It’s here: [Frequently asked questions](https://community.sonarsource.com/t/frequently-asked-questions/7204)

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 1, 2023, 8:48am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/10 "2023-02-01T08:48:12Z")

</div>

Thanks Ann, i referred the FAQ section there it’s mentioned few rules will not be supported by sonarlint  
Is there any alternative way to get all the sonarqube issues locally apart from using sonarlint?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 1, 2023, 1:30pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/11 "2023-02-01T13:30:40Z")

</div>

Hi,

SonarLint is your best bet.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 3, 2023, 9:41am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/12 "2023-02-03T09:41:15Z")

</div>

Hi Ann

Is there any possible way to run sonar scanner in our local pc , where already sonarqube quality profile rule set is exported and present in the form of XML file.  
Thereby getting the issues occurred locally without publishing into sonarqube

Thanks  
Divya

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 3, 2023, 1:15pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/13 "2023-02-03T13:15:20Z")

</div>

Hi Divya,

Sorry, SonarLint is all I have for you.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 6, 2023, 4:11am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/14 "2023-02-06T04:11:27Z")

</div>

Hi Ann,

By mentioning any flag in sonar properties file, is there any way to do all the sonar analysis without publishing the report to SonarQube dashboard.

Thanks Divya

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 6, 2023, 1:07pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/15 "2023-02-06T13:07:11Z")

</div>

Hi Divya,

No. SonarLint is the closest you’re going to get to a ‘local’ SonarQube analysis.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 10, 2023, 9:29am UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/16 "2023-02-10T09:29:27Z")

</div>

Hi Ann,

Thanks for the support

1. I’m using sonarlint and connected to my sonarqube project. Now Sonarlint has identified an issue (C:S125), same is reported by sonarQube with rule(c:CommentedCode) → Why the rule name got changed
2. The rule C:S125 is not present in the quality profile which i selected for my project → Then how this rule is identified by sonarlint

Thanks ,  
Divya

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 10, 2023, 2:55pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/17 "2023-02-10T14:55:03Z")

</div>

Hi Divya,

When we first started implementing rules, we gave them names. After a while we realized that wouldn’t be sustainable & started using numbers. Eventually we went back & renamed the old ones to their numbers.

That means that C:CommentedCode and C:S125 are the same thing. I’m not sure why the ID would show up differently. But if you want to pursue that I need to ask you to create a new thread.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 10, 2023, 3:10pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/18 "2023-02-10T15:10:41Z")

</div>

Hi Ann,

Thanks for the information

Is there any document available which has these kind of mapping?and how create a new thread

I observed certain rules including C:S125 it’s showing as a issue in one .c file and not showing in the other, any particular reason for that behaviour?

Thanks  
Divya

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 10, 2023, 3:25pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/19 "2023-02-10T15:25:46Z")

</div>

Hi Divya,

> [@Divya\_123](#):
>
> Is there any document available which has these kind of mapping?

No.

> [@Divya\_123](#):
>
> and how create a new thread

The “New Topic” button on the front page.

> [@Divya\_123](#):
>
> I observed certain rules including C:S125 it’s showing as a issue in one .c file and not showing in the other, any particular reason for that behaviour?

That needs a new thread too.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Divya\_123](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Divya\_123](https://community.sonarsource.com/u/Divya_123)\
**Post date:** [February 10, 2023, 3:39pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/20 "2023-02-10T15:39:17Z")

</div>

Sorry Ann  
I didn’t get your point, you mean to say for further discussion on this topic I need to create a new post and then asks questions?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 10, 2023, 3:56pm UTC](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335/21 "2023-02-10T15:56:13Z")

</div>

Hi Divya,

This thread is about

> [@Divya\_123](#):
>
> **Error message: Error converting value “common-c:DuplicatedBlocks” to type ‘System.Collections.Generic.Dictionary`2[System.String,SonarLint.VisualStudio.Core.RuleConfig]’. Path ‘[‘sonarlint.rules’]’, line 3, position 30.**  
> **Default settings will be used**

For other topics, you need to create new threads.

&nbsp;  
Ann

[Next page](https://community.sonarsource.com/t/error-converting-value-common-c-duplicatedblocks-to-type-system-collections-generic-dictionary/82335.md?page=2)
