Sonarlint.exe 不是有效的 Win32 应用程序
本文关键字:Win32 应用程序 有效 exe Sonarlint | 更新日期: 2023-09-27 18:35:45
我正在尝试使用sonarqube分析一个c#项目,但是我不断收到一个错误,说Sonarlint不是有效的win32应用程序,这是什么原因?
[15:51:01]: [Step 1/3] 15:51:01.807 INFO - Sensor FileHashSensor...
[15:51:01]: [Step 1/3] 15:51:01.838 INFO - Sensor FileHashSensor done: 31 ms
[15:51:01]: [Step 1/3] 15:51:01.838 INFO - Sensor org.sonar.plugins.csharp.CSharpSensor@375465a1...
[15:51:02]: [Step 1/3] INFO: ------------------------------------------------------------------------
[15:51:02]: [Step 1/3] INFO: EXECUTION FAILURE
[15:51:02]: [Step 1/3] INFO: ------------------------------------------------------------------------
[15:51:02]: [Step 1/3] Total time: 26.359s
[15:51:02]: [Step 1/3] Final Memory: 53M/1397M
[15:51:02]: [Step 1/3] ERROR: Error during Sonar runner execution
[15:51:02]: [Step 1/3] INFO: ------------------------------------------------------------------------
[15:51:02]: [Step 1/3] ERROR: Unable to execute Sonar
[15:51:02]: [Step 1/3] ERROR: Caused by: java.io.IOException: Cannot run program "X:'xxxx'xxxx'xxxx'xxxxxx'.'.sonar'SonarLint.Runner'SonarLint.Runner.exe": CreateProcess error=193, %1 is not a valid Win32 application
[15:51:02]: [Step 1/3] ERROR: Caused by: Cannot run program "X:'xxxx'xxxx'xxxxx'xxxxx'.'.sonar'SonarLint.Runner'SonarLint.Runner.exe": CreateProcess error=193, %1 is not a valid Win32 application
[15:51:02]: [Step 1/3] ERROR: Caused by: CreateProcess error=193, %1 is not a valid Win32 application
使用不依赖/利用 sonarlint 的 c# 插件版本,我使用的是 3.3,问题是它是旧版本,因此没有最新的规则。
SonarQube C# 插件需要安装 .NET Framework 4.6 版。根据 https://msdn.microsoft.com/en-us/library/8z6watww(v=vs.110).aspx,.NET Framework 从 4.5 版开始不再支持 Windows Server 2003。
我建议您升级服务器的操作系统并使用最新的SonarQube C#插件,而不是使用旧的不受支持的软件。