SonarQube 运行 .net 项目错误:MsBuild.exe/t:Rebuild 'MsBuild.exe' 未被识别为内部或外部命令



我已经安装了SonarQube,我能够运行。net核心项目并分析代码,但是我试图在。net项目上运行,它不起作用,

我遵循的步骤:

1-我在SonarQube中创建了一个项目,在构建时我选择了。net和构建工具。net框架

在我的。net应用程序代码或解决方案的根中,我运行生成的命令
SonarScanner.MSBuild.exe begin /k:"ULO-DEVProject" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="sqp_4ee1f72f8456599998db59ffe007afbeb2e73284"

this run successfull

运行MsBuild.exe/t:Rebuild

我得到下面的错误:

'MsBuild.exe' is not recognized as an internal or external command,
operable program or batch file.

我通过向系统环境变量中添加path来解决我的问题,路径看起来像这样。确保找到存在MSBuild.exe的visual studio bin文件夹。

C:Program FilesMicrosoft Visual Studio2022ProfessionalMSBuildCurrentBin