versions used :
sonarlint 5.1.0
visual studio 16.11.7 commuity version
vscode 1.62.3
cmake 3.16.4
error observed
[CFamily Analysis] Error creating VCX request. File: xxxxx.cpp, Error: System.ArgumentException: Unsupported PlatformName: win32
Argument name: platformName
at SonarLint.VisualStudio.Integration.Vsix.CFamily.CFamilyHelper.Capture.IsPlatformX64(String platformName)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.CFamilyHelper.Capture.ToCaptures(IFileConfig fileConfig, String path, String& cfamilyLanguage)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.VcxRequestFactory.ToRequest(IFileConfig fileConfig, String path)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.VcxRequestFactory.CreateRequest(String analyzedFilePath, CFamilyAnalyzerOptions analyzerOptions, IFileConfig fileConfig)
at SonarLint.VisualStudio.Integration.Vsix.CFamily.VcxProject.VcxRequestFactory.TryCreateSync(String analyzedFilePath, CFamilyAnalyzerOptions analyzerOptions)
steps to reproduce
1. create a cpp file and write a CMakeLists.txt
2. using cmake to create a solution for vs 32bit x86 toolkits
3. open solution in vs and open cpp file.
4. find error in output panels of sonarlint
potential workaround
64bit solution is fine. but it’s not a workaround, right?
Thanks for the detailed explanation. I created a ticket to fix this.
The problem is that we are expecting Win32 and you are providing win32.
The default name by VisualStudion is Win32 but since you can generate it from CMake as win32 I created a ticket to support your case.
As a workaround, you can change the CMake generation script to Win32. Assuming you are doing -A win32 instead of -A Win32.
Thank you @Abbas, looking forward for the solution.
And we create vs solution/projects within vscode using UI, not by cmd line, so not konw how to change the CMake generation script yet. We can wait and it’s not so urgent for us.