xbuild(1)
π xbuild(1) π
okay bestie, welcome to the xbuild(1) page from the General Commands Manual β yes it's section 1, yes it's a command, we're doing this π
β¨ NAME β¨
xbuild β Mono's tool to build MSBuild project files π
π SYNOPSIS π
xbuild [option] [project-file]
πΈ DESCRIPTION πΈ
So xbuild builds MSBuild project files, periodt. IDEs like MonoDevelop and "Microsoft Visual Studio .NET" both use the msbuild project file format, so this is your girl for that π«Ά
The main argument you hand her is the path of the project or solution file to build. And if you don't specify a file at all? She doesn't just sit there β she tries to build any solution file or project file in the current directory that has a *proj extension. main character energy honestly π
β¨ OPTIONS β¨
/target:T1[,TN]β the list of targets to build π―/property:Name=Valueβ set or override project properties βοΈ/logger:<logger>β a custom logger to log build events πͺ΅/toolsversion:version,/tv:versionβ specify the toolset version to use.- eg.
/tv:4.0β this would cause the4.0version of theMicrosoft.Common.targets(among others) to be used. This overrides the value specified in a project file. π - Valid values:
2.0,3.0,3.5and4.0
- eg.
/verbosity:<level>β logger verbosity level:quiet,minimal,normal,detailed,diagnosticπ/validateβ validate the project file against the schema β/validate:<schema>β validate the project file against the specified schema β/consoleloggerparameters:<params>,/clp:<params>β parameters for the console logger:PerfomanceSummary,Summary,NoSummary,NoItemAndPropertyList,Verbosityπ₯οΈ/filelogger[n],/fl[n]β logs the output to a file, namedmsbuild.logby default. If the optional numbernis specified, then it logs tomsbuild[n].log. Parameters for this logger, including the log file name, can be specified via a corresponding/flp[n]option. Default verbosity for file loggers isdetailed.ncan be between1-9. π/fileloggerparameters[n]:<params>,/flp[n]:<params>β parameters for a file logger. This implies a corresponding/fl[n].ncan be between1-9, and is used to add upto 10 file loggers. Parameters can be, besides the ones available for console logger:LogFile=<file>β file to which the build log will be written. πAppendβ if this is used, then the log file is appended to, else a new one will be created.Encoding=<encoding>β encoding to use for the log file, eg.UTF-8,ASCII.- Eg:
xbuild foo.csproj /flp:Verbosity=normal "/flp1:LogFile=build.log;Append;Encoding=ASCII"
/nologoβ don't show the initial xbuild banner π/helpβ show xbuild usage π/versionβ display xbuild version π’
π¦ ENVIRONMENT VARIABLES π¦
XBUILD_EMIT_SOLUTIONβ if this variable is set, then the project file generated from a solution file is emitted. πΎXBUILD_LOG_REFERENCE_RESOLVERβ references are resolved by trying a list of assembly search paths ($(AssemblySearchPaths)). If xbuild is unable to resolve a reference, then it logs details of why the various search paths failed. If this variable is set, then it logs the same even for references that were resolved successfully. These logs show up if the verbosity is set todetailedor higher. πMSBuildExtensionsPathβ MSBuild extensions are usually installed in$(MSBuildExtensionsPath), which xbuild resolves to$prefix/lib/mono/xbuild. When used inImport, like:
<Import Project="$(MSBuildExtensionsPath)\TestTargets.targets"/>
xbuild tries various values for the msbuild property $(MSBuildExtensionsPath), in order:
- Paths specified in the environment variable
$MSBuildExtensionsPath. /Library/Frameworks/Mono.framework/External/xbuildon Mac OSX.$XDG_CONFIG_HOME/xbuild/tasks(orEnvironment.SpecialFolder.ApplicationData)$prefix/lib/mono/xbuild(default location)
Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve to the default location. This is a xbuild-only feature. This is also applicable for the properties $(MSBuildExtensionsPath32) and $(MSBuildExtensionsPath64), and the environment variables have the corresponding names β MSBuildExtensionsPath32/64. β¨
XBUILD_FRAMEWORK_FOLDERS_PATHβ withToolsVersion 4.0, projects can target arbitrary frameworks referenced byTargetFrameworkMoniker, which is of the format:
Identifier,Version=<version>[,Profile=<profile>]
Eg. ".NETFramework,Version=v4.0"
The 3 parts of the moniker are given by the msbuild properties:
$(TargetFrameworkIdentifier), $(TargetFrameworkVersion) and $(TargetFrameworkProfile)
This moniker maps to a framework description file on disk:
<framework_root>/Identifier/Version/[Profile]/RedistList/FrameworkList.xml
This file is used to determine the path where to find the framework assemblies for this particular framework.
Framework root here is configurable and is resolved in the following order:
- Paths specified in the environment variable
$XBUILD_FRAMEWORK_FOLDERS_PATH /Library/Frameworks/Mono.framework/External/xbuild-frameworkson Mac OSX.- MSBuild property
$(TargetFrameworkRoot) $prefix/lib/mono/xbuild-frameworks(default location)
XBuild tries the paths given above, in order, till it finds a FrameworkList.xml for the moniker. Running with /v:detailed or higher verbosity will show the various paths that it tries. π
The FrameworkList.xml itself just has a root element like:
<FileList Name=".NET Framework 3.5" TargetFrameworkDirectory="..\..\..\..\3.5" IncludeFramework="v3.0">
</FileList>
Here the TargetFrameworkDirectory attribute specifies the directory where the assemblies for this particular framework can be found. If this is not set, then the parent of the folder containing the xml file is taken as the framework directory.
IncludeFramework attribute specifies the version of a framework (under the same $(TargetFrameworkIdentifier)) which should be included in the final list of Target framework directories. π§
XBUILD_COLORSβ if this variable is set, it contains a string of the form"type=foreground,type=.."that specifies which color to use to display errors/warnings etc on some terminals. Type here can be:errors,warnings,messagesoreventsevents: these are project/target/task start and end event messages.
The possible colors for foreground are: black, red, brightred, green, brightgreen, yellow, brightyellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, grey, white and brightwhite. π
For example, you could set this variable from your shell:
export XBUILD_COLORS
XBUILD_COLORS=errors=brightred,warnings=blue
You can disable the built-in color scheme by setting this variable to "disable". π«
π NOTES π
On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" π
π SEE ALSO π
π COPYRIGHT π
Copyright (C) 2011 Novell, Inc (http://www.novell.com)
π MAILING LISTS π
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
π WEB SITE π
Visit: http://www.mono-project.com for details
and that's the whole page bestie π«Ά the footer is literally just xbuild(1) again β no version, no date, nothing extra, and honestly? iconic. now go build something, you got this π
β¨π
π¦ where this page comes from
- alpine 3.24: mono-doc 6.14.1-r1 Β· MIT
- epel 10: mono-devel 6.14.1-1.el10_2 Β· MIT
- fedora 44: mono-devel 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-devel 6.14.1-3.fc44 Β· MIT
- fedora 44: mono-devel 6.14.1-4.fc44 Β· MIT
- fedora 44: mono-devel 6.14.1-4.fc44 Β· MIT
- nixos 26.05: mono 6.14.1
- nixpkgs unstable: mono 6.14.1
- ubuntu resolute: mono-devel 6.14.1+ds2-2 Β· MIT
- ubuntu stonking: mono-devel 6.14.1+ds2-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms