AssemblyInfo.vb' can not be decided as the file matches patterns of both sonar.lang.patterns.vbnet : **/*.vb,**/*.vb and sonar.lang.patterns.vb :

Hi Team,

I’m getting the bellow errors could anyone suggest how to fix it?
I have tried the adding the file suffixes as .vb still I’m seeing the issue could anyone what to do?

INFO: Project configuration:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.216s
INFO: Final Memory: 7M/30M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Language of file ‘Chain Host\DotNet\HfWLogging\AssemblyInfo.vb’ can not be decided as the file matches patterns of both sonar.lang.patterns.vbnet : /*.vb,/.vb and sonar.lang.patterns.vb : **/.vb,/*.bas,/.frm,**/.ctl,/*.vb,/.bas,**/.frm,**/*.ctl

Hi,

Each file extension can be claimed by one and only one language. Right now, you have two languages claiming the extension. IIRC, the set of claimed extensions is blank for one of those languages (VB6?) & so you must already have experience editing the language suffixes.

What I recommend is making sure the VB6 extension list is empty at the global level. Then at the project level, add .vb for VB6, and reset the list for VB.NET to something like .foo. Why not just blank it out? Because then it would reset to the default: .vb and your conflict is back.

Hope this makes sense.

 
Ann

@ganncamp I’m unable to find the language settings at global level. could you please help me where I can find the global level settings. Currently we are using enterprise edition.

Hi,

Depending on your version, once you go to Administration, you’ll either see the language itself in the list on the left or the word “Languages”.

 
HTH,
Ann

Hi @ganncamp I’m able to see the language settings in project level and in global level i’m unable to see that options. Even Administration tab is not present I think it is enterprise version so they have not enabled that option to us.

Okay! If you don’t see ‘Administration’ in the top menu then you’re not a global administrator. So then just set this at the project level and you should be good to go.

 
Ann

Can also be set in sonar-project.properties, right?

Hi,

Good point. Yes, probably. Not all properties can be set analysis-side, but this one probably can. The question is getting the right property names:

  • sonar.vbnet.file.suffixes
  • sonar.vb.file.suffixes (probably; this language isn’t loaded in our internal instance, so I couldn’t look up the property name from the UI)

 
HTH,
Ann

Sounds right. We don’t have VB either.

We routinely use this to switch .sql files between PL/SQL and T/SQL scanners.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Just for reference:
While having VB.NET files in the project, this can be used to turn off VB6 patterns in scanner begin step

SonarScanner.MSBuild.exe begin /k:"Something" /d:sonar.lang.patterns.vb="*.bas"
1 Like