Please provide
- Operating system: Windows 10
- Visual Studio version: 2022 Community Edition
- SonarLint plugin version: 8.1.0.95039
- Programming language you’re coding in: C++
- Is connected mode used: no
- Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
I am currently working to configure sonarlint for a C++ project. I have installed the SonarLint extension from Visual Studio. When I open a .cpp file I am getting below errors.
We are using MakeFile in Configuration type and platform toolset being used is v140.
[ThreadId 1] [DEBUG] [VCX:VcxRequestFactory] [Thread id: 1] Could not get the file configuration
[ThreadId 1] [DEBUG] [VCX:VcxRequestFactory] [Thread id: 1] Could not get the file configuration
[ThreadId 48] [DEBUG] [ExclusionSettingsStorage] Standalone mode, exclusions are not supported.
[ThreadId 48] [DEBUG] [AnalyzableFileIndicator] No server settings were found.
[ThreadId 48] [SecretsAnalyzer] Analyzing C:\Git_repos\test\cpp\test.cpp
[ThreadId 25] [DEBUG] [CompilationDatabaseLocator] Could not find project root directory
[ThreadId 23] [DEBUG] [CompilationDatabaseLocator] Could not find project root directory
[ThreadId 48] [SecretsAnalyzer] Finished analyzing C:\Git_repos\test\test.cpp, analysis time: 0.058s
[ThreadId 48] [SecretsAnalyzer] Found 0 issue(s) for C:\Git_repos\test\test.cpp
[ThreadId 48] [DEBUG] [VCX:VcxRequestFactory] [Thread id: 48] Trying to create request for C:\Git_repos\test\test.cpp
[ThreadId 1] [CFamily Analysis] Error retrieving VCX configuration. File: C:\Git_repos\test\test.cpp, Error: System.ArgumentException: Unsupported StructMemberAlignment: 1Byte
Parameter name: value
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.CmdBuilder.ConvertStructMemberAlignment(String value)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.CmdBuilder.AddOptFromProperties(IVCRulePropertyStorage properties)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.FileConfig.TryGet(ILogger logger, ProjectItem dteProjectItem, String absoluteFilePath)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.FileConfigProvider.Get(ProjectItem projectItem, String analyzedFilePath, CFamilyAnalyzerOptions analyzerOptions)
[ThreadId 1] [DEBUG] [VCX:VcxRequestFactory] [Thread id: 1] Could not get the file configuration
[ThreadId 86] [DEBUG] [CompilationDatabaseLocator] Could not find project root directory
[ThreadId 86] Unable to retrieve the configuration for file 'C:\Git_repos\test\test.cpp'.
Check the file is part of a supported project type in the current solution.
Since there was an error related to CompilationDatabaseLocator, I have generated compile_commands.json file and tried to use it in settings. I am still getting the same error.