本文介绍了SonarScanner提供的``MsBuild.exe''在TFS 2018上不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在将SonarQube添加到现有的TFS 2018版本中.我遵循的下载指导位于此处 https: //docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild .

I'm adding SonarQube to existing TFS 2018 builds. I was following the directions for downloading Community Edition 7.4 located here https://docs.sonarqube.org/display/SCAN/Install+the+SonarScanner+for+MSBuild.

按照《快速安装指南》中的步骤操作 https://docs.sonarqube.org/latest/setup/get-started-2-minutes/我到达以下部分,要求我使用以下命令从您的计算机执行MSBuild扫描仪":

Going through the steps of the Quick Installation Guide https://docs.sonarqube.org/latest/setup/get-started-2-minutes/I get to the part where I’m asked to "Execute the Scanner for MSBuild from your computer" using the below commands:

  1. SonarScanner.MSBuild.exe开始/k:"{key}"/d:sonar.host.url="http://localhost:9000"/d:sonar.login="{key}"
  2. MsBuild.exe/t:重建
  3. SonarScanner.MSBuild.exe结束/d:sonar.login ="{key}"

当我运行第一个命令时,它会成功C:\ sonar-scanner-msbuild-4.4.2.1543-net46> SonarScanner.MSBuild.exe开始/k:"{key}"/d:sonar.host.url="http://localhost:9000"/d: sonar.login ="{key}"

When I run the first command it succeedsC:\sonar-scanner-msbuild-4.4.2.1543-net46> SonarScanner.MSBuild.exe begin /k:"{key}" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="{key}"

用于MSBuild 4.4.2的SonarScanner将.NET Framework版本的Scanner用于MSBuild默认属性文件位于C:\ sonar-scanner-msbuild-4.4.2.1543-net46 \ SonarQube.Analysis.xml从C:\ sonar-scanner-msbuild-4.4.2.1543-net46 \ SonarQube.Analysis.xml加载分析属性预处理开始.正在准备工作目录...13:32:09.468更新构建集成目标...13:32:09.5正在获取分析配置设置...13:32:10.173为CS提供预配置分析器组件...13:32:10.173安装所需的Roslyn分析仪...13:32:10.579为vbnet供应配置分析器组件...13:32:10.579安装所需的Roslyn分析仪...13:32:10.735预处理成功.

SonarScanner for MSBuild 4.4.2Using the .NET Framework version of the Scanner for MSBuildDefault properties file was found at C:\sonar-scanner-msbuild-4.4.2.1543-net46\SonarQube.Analysis.xmlLoading analysis properties from C:\sonar-scanner-msbuild-4.4.2.1543-net46\SonarQube.Analysis.xmlPre-processing started.Preparing working directories...13:32:09.468 Updating build integration targets...13:32:09.5 Fetching analysis configuration settings...13:32:10.173 Provisioning analyzer assemblies for cs...13:32:10.173 Installing required Roslyn analyzers...13:32:10.579 Provisioning analyzer assemblies for vbnet...13:32:10.579 Installing required Roslyn analyzers...13:32:10.735 Pre-processing succeeded.

但是,当我运行第二个命令"MsBuild.exe/t:Rebuild"时,它失败并显示以下错误:

However when I run the second command "MsBuild.exe /t:Rebuild" It fails with the following error:

C:\ Program Files(x86)> MsBuild.exe/t:重建无法将"MsBuild.exe"识别为内部或外部命令,可操作的程序或批处理文件.

C:\Program Files (x86)>MsBuild.exe /t:Rebuild'MsBuild.exe' is not recognized as an internal or external command,operable program or batch file.

我确认我添加/更新了环境变量%PATH%,MsBuild存在,我想知道是否还有针对.NET 4.5框架的说明中未提到的其他步骤?有人使用TFS构建遇到.NET错误吗?

I confirmed I added/updated environmental variables %PATH%, MsBuild exists, I’m wondering if there’s an additional step not noted in the instructions for .NET 4.5 framework? Has anyone come across this error for .NET using TFS builds or has any thoughts?

推荐答案

尝试输入msbuild的确切路径,例如VS2017 Professional命令应为:

Try to enter exact path of msbuild e.g. for VS2017 Professional command should be:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\"MsBuild.exe /t:Rebuild

这篇关于SonarScanner提供的``MsBuild.exe''在TFS 2018上不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 20:52