https://docs.microsoft.com/en-us/visualstudio/msbuild/walkthrough-using-msbuild?view=vs-2019
The path to MSBuild when installed with the .NET framework:
C:\Windows\Microsoft.NET\Framework[64 or empty][framework_version]
The path to MSBuild when installed with Visual Studio is:
C:\Program Files (x86)\MSBuild[version]\Bin for x86
C:\Program Files (x86)\MSBuild[version]\Bin\amd64 for x64.
The path when BuildTools_Full.exe is installed is the same as when MSBuild is installed with Visual Studio.
MSBuild is now installed in a folder under each version of Visual Studio. For example,
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild.
msbuild Project.Build.msbuildproj /p:NuGetExe=".nuget/nuget.exe"
dotnet vstest mytestproject.dll --logger:"trx;LogFileName=custom_file_name.trx" --ResultsDirectory:custom/file/path
dotnet vstest mytestproject.dll myothertestproject.exe
dotnet build command is equivalent to dotnet msbuild -restore.
dotnet vstest command is superseded by dotnet test, which can now be used to run assemblies. See dotnet test.
dotnet publish command calls MSBuild, which invokes the Publish target.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" CoreAgent1.csproj /t:Restore;Rebuild;Publish /p:PublishSingleFile=True /p:SelfContained=True /p:PublishProtocol=FileSystem /p:Configuration=Release /p:Platform=x64 /p:TargetFrameworks=netcoreapp3.1 /p:PublishDir=bin\Release\netcoreapp3.1\publish\win-x64 /p:RuntimeIdentifier=win-x64 /p:PublishReadyToRun=False /p:PublishTrimmed=False
MSBuild.exe" /t:restore
msbuild mysolution.sln /p:OutDir=c:\mydir
dotnet
SonarScanner.MSBuild.exe begin /k:“project-key”
MSBuild.exe
withSonarQubeEnv(credentialsId: ‘f225455e-ea59-40fa-8af7-08176e86507a’, installationName: ‘My SonarQube Server’) { // You can override the credential to be used
sh ‘mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar’
}
def sqScannerMsBuildHome = tool ‘Scanner for MSBuild 4.6’
withSonarQubeEnv(‘My SonarQube Server’) {
bat “
s
q
S
c
a
n
n
e
r
M
s
B
u
i
l
d
H
o
m
e
S
o
n
a
r
Q
u
b
e
.
S
c
a
n
n
e
r
.
M
S
B
u
i
l
d
.
e
x
e
b
e
g
i
n
/
k
:
m
y
K
e
y
"
b
a
t
′
M
S
B
u
i
l
d
.
e
x
e
/
t
:
R
e
b
u
i
l
d
′
b
a
t
"
{sqScannerMsBuildHome}\\SonarQube.Scanner.MSBuild.exe begin /k:myKey" bat 'MSBuild.exe /t:Rebuild' bat "
sqScannerMsBuildHomeSonarQube.Scanner.MSBuild.exebegin/k:myKey"bat′MSBuild.exe/t:Rebuild′bat"{sqScannerMsBuildHome}\SonarQube.Scanner.MSBuild.exe end”
}