# Visual Studio build v1
# Build with MSBuild and set the Visual Studio version property.
- task: VSBuild@1
inputs:
solution: '**\*.sln' # string. Required. Solution. Default: **\*.sln.
#vsVersion: 'latest' # 'latest' | '17.0' | '16.0' | '15.0' | '14.0' | '12.0' | '11.0'. Visual Studio Version. Default: latest.
#msbuildArgs: # string. MSBuild Arguments.
#platform: # string. Platform.
#configuration: # string. Configuration.
#clean: false # boolean. Clean. Default: false.
# Advanced
#maximumCpuCount: false # boolean. Build in Parallel. Default: false.
#restoreNugetPackages: false # boolean. Restore NuGet Packages. Default: false.
#msbuildArchitecture: 'x86' # 'x86' | 'x64'. MSBuild Architecture. Default: x86.
#logProjectEvents: true # boolean. Record Project Details. Default: true.
#createLogFile: false # boolean. Create Log File. Default: false.
#logFileVerbosity: 'normal' # 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic'. Optional. Use when createLogFile = true. Log File Verbosity. Default: normal.
#enableDefaultLogger: true # boolean. Enable Default Logger. Default: true.
#customVersion: # string. Custom Version.
# Visual Studio build v1
# Build with MSBuild and set the Visual Studio version property.
- task: VSBuild@1
inputs:
solution: '**\*.sln' # string. Required. Solution. Default: **\*.sln.
#vsVersion: 'latest' # 'latest' | '16.0' | '15.0' | '14.0' | '12.0' | '11.0'. Visual Studio Version. Default: latest.
#msbuildArgs: # string. MSBuild Arguments.
#platform: # string. Platform.
#configuration: # string. Configuration.
#clean: false # boolean. Clean. Default: false.
# Advanced
#maximumCpuCount: false # boolean. Build in Parallel. Default: false.
#restoreNugetPackages: false # boolean. Restore NuGet Packages. Default: false.
#msbuildArchitecture: 'x86' # 'x86' | 'x64'. MSBuild Architecture. Default: x86.
#logProjectEvents: true # boolean. Record Project Details. Default: true.
#createLogFile: false # boolean. Create Log File. Default: false.
#logFileVerbosity: 'normal' # 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic'. Optional. Use when createLogFile = true. Log File Verbosity. Default: normal.
Inputs
solution
- Solutionstring
. Required. Default value: **\*.sln
.
Specifies the solution for the task to use in the build process.
If you want to build a single solution, click the ... button and specify the solution.
If you want to build multiple solutions, specify the search criteria. You can use a single-folder wildcard (*
) and recursive wildcards (**
). For example, **.sln
searches for all .sln files in all subdirectories.
Make sure the solutions you specify are downloaded by this build pipeline. On the Repository tab:
Tip
For information on the differences between MSBuild and Visual Studio build, see Visual Studio builds vs. MSBuild.exe builds.
vsVersion
- Visual Studio Versionstring
. Allowed values: latest
, 17.0
(Visual Studio 2022), 16.0
(Visual Studio 2019), 15.0
(Visual Studio 2017), 14.0
(Visual Studio 2015), 12.0
(Visual Studio 2013), 11.0
(Visual Studio 2012). Default value: latest
.
The value of this input must match the version of Visual Studio used to create your solution.
Adds the /p:VisualStudioVersion={numeric_visual_studio_version}
argument to the MSBuild command run by the build. For example, if you specify Visual Studio 2015, /p:VisualStudioVersion=14.0
is added to the MSBuild command.
Azure Pipelines: If your team wants to use Visual Studio with the Microsoft-hosted agents, select windows-latest as your default build pool. See Microsoft-hosted agents.
vsVersion
- Visual Studio Versionstring
. Allowed values: latest
, 16.0
(Visual Studio 2019), 15.0
(Visual Studio 2017), 14.0
(Visual Studio 2015), 12.0
(Visual Studio 2013), 11.0
(Visual Studio 2012). Default value: latest
.
The value of this input must match the version of Visual Studio used to create your solution.
Adds the /p:VisualStudioVersion={numeric_visual_studio_version}
argument to the MSBuild command run by the build. For example, if you specify Visual Studio 2015, /p:VisualStudioVersion=14.0
is added to the MSBuild command.
Azure Pipelines: If your team wants to use Visual Studio with the Microsoft-hosted agents, select windows-latest as your default build pool. See Microsoft-hosted agents.
platform
- Platformstring
.
Specifies the platform you want to build, such as Win32
, x86
, x64
, or any cpu
.
Tip
AnyCPU
(no whitespace).BuildPlatform
on the Variables tab (selecting Allow at Queue Time) and reference it here as $(BuildPlatform)
. This way you can modify the platform when you queue the build and enable building multiple configurations.configuration
- Configurationstring
.
Specifies the configuration you want to build, such as debug
or release
.
Tip
Declare a build variable such as BuildConfiguration
on the Variables tab (selecting Allow at Queue Time) and reference it here as $(BuildConfiguration)
. This way you can modify the platform when you queue the build and enable building multiple configurations.
clean
- Cleanboolean
. Default value: false
.
If set to false
, the task makes an incremental build. This setting might reduce your build time, especially if your codebase is large. This option has no practical effect unless you also set the Clean repository to false
.
If set to true
, the task rebuilds all of the code in the code projects. This is equivalent to the MSBuild /target:clean
argument.
maximumCpuCount
- Build in Parallelboolean
. Default value: false
.
Optional. If your MSBuild target configuration is compatible with building in parallel, you can check this input to pass the /m
switch to MSBuild (Windows only). If your target configuration is not compatible with building in parallel, checking this option may cause your build to result in file-in-use errors, or intermittent or inconsistent build failures.
restoreNugetPackages
- Restore NuGet Packagesboolean
. Default value: false
.
This input is deprecated. To restore NuGet packages, add a NuGet Tool Installer task before the build.
msbuildArchitecture
- MSBuild Architecturestring
. Allowed values: x86
(MSBuild x86), x64
(MSBuild x64). Default value: x86
.
Optional. Supplies the architecture (x86
or x64
) of MSBuild to run.
Tip
Because Visual Studio runs as a 32-bit application, you may experience problems when your build is processed by a build agent that is running the 64-bit version of Team Foundation Build Service. By selecting MSBuild x86
, you may resolve these issues.
logProjectEvents
- Record Project Detailsboolean
. Default value: true
.
Optional. Records timeline details for each project.
createLogFile
- Create Log Fileboolean
. Default value: false
.
Optional. Creates a log file (Windows only).
logFileVerbosity
- Log File Verbositystring
. Optional. Use when createLogFile = true
. Allowed values: quiet
, minimal
, normal
, detailed
, diagnostic
. Default value: normal
.
Specifies the verbosity level in log files.
enableDefaultLogger
- Enable Default Loggerboolean
. Default value: true
.
If set to true
, enables the default logger for MSBuild.
customVersion
- Custom Versionstring
.
Sets a custom version of Visual Studio. Examples: 15.0
, 16.0
, 17.0
. The required version of Visual Studio must be installed in the system.
Azure Pipelines: If your team wants to use Visual Studio 2022 with the Microsoft-hosted agents, select windows-2022
as your default build pool. For more info see Microsoft-hosted agents.
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
Output variablesNone.
Why is my build pipeline failing and prompting for Single Sign-On (SSO) authentication?Builds can fail if credentials have expired. To avoid these failures, we recommend using the NuGet Authenticate task to reinstall the credential provider and automatically refresh credentials. This ensures uninterrupted access during pipeline execution.
steps:
# Authenticate with NuGet to ensure credentials are refreshed
- task: NuGetAuthenticate@1
# Build the solution using VSBuild
- task: VSBuild@1
inputs:
solution: '**/*.sln'
Learn more about installing Visual Studio images on Azure.
Important
This task is only supported on agents running Windows.
Requirements Requirement Description Pipeline types YAML, Classic build Runs on Agent, DeploymentGroup Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: msbuild, visualstudio Capabilities This task does not satisfy any demands for subsequent tasks in the job. Command restrictions Any Settable variables Any Agent version 1.95.0 or greater Task category BuildRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4