1xbuild(1) General Commands Manual xbuild(1)
2
3
4
6 xbuild - Mono's tool to build MSBuild project files
7
9 xbuild [option] [project-file]
10
12 xbuild can be used to build MSBuild project files. Integrated Develop‐
13 ment Environments like MonoDevelop and "Microsoft Visual Studio .NET"
14 use msbuild project file format.
15
16 xbuild takes the path of the project or solution file to build, as the
17 main argument. If no file is specified then it tries to build any
18 solution file or project file in the current directory, that has a
19 *proj extension.
20
22 /target:T1[,TN]
23 List of targets to build
24
25 /property:Name=Value
26 Set or override project properties
27
28 /logger:<logger>
29 Custom logger to log build events
30
31 /toolsversion:version , /tv:version
32 Specify the toolset version to use.
33
34 Eg. /tv:4.0
35 This would cause 4.0 version of the Microsoft.Common.targets
36 (among others) to be used. This overrides
37 the value specified in a project file.
38
39 Valid values: 2.0, 3.0, 3.5 and 4.0
40
41 /verbosity:<level>
42 Logger verbosity level : quiet, minimal, normal, detailed, diag‐
43 nostic
44
45 /validate
46 Validate the project file against the schema
47
48 /validate:<schema>
49 Validate the project file against the specified schema
50
51 /consoleloggerparameters:<params> , /clp:<params>
52 Parameters for the console logger : PerfomanceSummary, Summary,
53 NoSummary, NoItemAndPropertyList, Verbosity
54
55 /filelogger[n] , /fl[n]
56 Logs the output to a file, named 'msbuild.log' by default. If
57 the optional number 'n' is specified, then it logs to
58 'msbuild[n].log' . Parameters for this logger, including the log
59 file name can be specified via a corresponding /flp[n] option.
60 Default verbosity for file loggers is 'detailed. 'n' can be
61 between 1-9.
62
63 /fileloggerparameters[n]:<params> , /flp[n]:<params>
64 Parameters for a file logger. This implies a corresponding
65 /fl[n]. 'n' can be between 1-9, and is used to add upto 10 file
66 loggers. Parameters can be, besides the ones available for con‐
67 sole logger:
68
69 LogFile=<file>
70 File to which the build log will be written.
71
72 Append If this is used, then the log file is appended to, else a
73 new one will be created.
74
75 Encoding=<encoding>
76 Encoding to use for the log file, eg. UTF-8, ASCII.
77
78 Eg: xbuild foo.csproj /flp:Verbosity=normal "/flp1:Log‐
79 File=build.log;Append;Encoding=ASCII"
80
81 /nologo
82 Don't show the initial xbuild banner
83
84 /help Show xbuild usage
85
86 /version
87 Display xbuild version
88
90 XBUILD_EMIT_SOLUTION
91 If this variable is set, then the project file generated from a
92 solution file is emitted.
93
94 XBUILD_LOG_REFERENCE_RESOLVER
95 References are resolved by trying a list of assembly search
96 paths ($(AssemblySearchPaths)). If xbuild is unable to resolve
97 a reference, then it logs details of why the various search
98 paths failed. If this variable is set, then it logs the same
99 even for references that were resolved successfully. These logs
100 show up if the verbosity is set to detailed or higher.
101
102 MSBuildExtensionsPath
103 MSBuild extensions are usually installed in $(MSBuildExtension‐
104 sPath), which xbuild resolves to $prefix/lib/mono/xbuild . When
105 used in Import, like:
106
107 <Import Project="$(MSBuildExtensionsPath)\TestTargets.tar‐
108 gets"/>
109
110 xbuild tries various values for the msbuild property
111 $(MSBuildExtensionsPath), in order:
112
113 1. Paths specified in the environment variable $MSBuildExten‐
114 sionsPath.
115 2. /Library/Frameworks/Mono.framework/External/xbuild on Mac
116 OSX.
117 3. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.Special‐
118 Folder.ApplicationData)
119 4. $prefix/lib/mono/xbuild (default location)
120
121 Anywhere else in the project files, $(MSBuildExtensionsPath)
122 will always resolve to the default location. This is a xbuild-
123 only feature. This is also applicable for the properties
124 $(MSBuildExtensionsPath32) and $(MSBuildExtensionsPath64), and
125 the environment variables have the corresponding names -
126 MSBuildExtensionsPath32/64 .
127
128 XBUILD_FRAMEWORK_FOLDERS_PATH
129 With ToolsVersion 4.0, projects can target arbitrary frameworks
130 referenced by TargetFrameworkMoniker, which is of the format:
131
132 Identifier,Version=<version>[,Profile=<profile>]
133
134 Eg. ".NETFramework,Version=v4.0"
135
136 The 3 parts of the moniker are given by the msbuild properties:
137
138 $(TargetFrameworkIdentifier), $(TargetFrameworkVersion) and
139 $(TargetFrameworkProfile)
140
141 This moniker maps to a framework description file on disk:
142
143 <framework_root>/Identifier/Version/[Profile]/Redis‐
144 tList/FrameworkList.xml
145
146 This file is used to determine the path where to find the frame‐
147 work assemblies for this particular framework.
148
149 Framework root here is configurable and is resolved in the fol‐
150 lowing order:
151
152 1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
153 2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
154 3. MSBuild property $(TargetFrameworkRoot)
155 4. $prefix/lib/mono/xbuild-frameworks (default location)
156
157 XBuild tries the paths given above, in order, till it finds a
158 FrameworkList.xml for the moniker. Running with /v:detailed or
159 higher verbosity will show the various paths that it tries.
160
161 The FrameworkList.xml itself just has a root element like:
162
163 <FileList Name=".NET Framework 3.5" TargetFrameworkDirec‐
164 tory="..\..\..\..\3.5" IncludeFramework="v3.0">
165 </FileList>
166
167 Here the TargetFrameworkDirectory attribute specifies the direc‐
168 tory where the assemblies for this particular framework can be
169 found. If this is not set, then the parent of the folder con‐
170 taining the xml file is taken as the framework directory.
171
172 IncludeFramework attribute specifies the version of a framework
173 (under the *same* $(TargetFrameworkIdentifier)) which should be
174 included in the final list of Target framework directories.
175
176
177 XBUILD_COLORS
178 If this variable is set, it contains a string of the form
179 "type=foreground,type=.." that specifies which color to use to
180 display errors/warnings etc on some terminals. Type here can be:
181
182 errors, warnings, messages or events
183
184 events: These are project/target/task start and end event
185 messages.
186
187 The possible colors for foreground are: black, red, brightred,
188 green, brightgreen, yellow, brightyellow, blue, brightblue,
189 magenta, brightmagenta, cyan, brightcyan, grey, white and
190 brightwhite.
191
192 For example, you could set this variable from your shell:
193 export XBUILD_COLORS
194 XBUILD_COLORS=errors=brightred,warnings=blue
195
196 You can disable the built-in color scheme by setting this vari‐
197 able to "disable".
198
199
201 On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally
202 looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
203
204
206 mono(1),[22mmcs(1)
207
209 Copyright (C) 2011 Novell, Inc (http://www.novell.com)
210
212 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for
213 details.
214
216 Visit: http://www.mono-project.com for details
217
218
219
220 xbuild(1)