Is it possible to build MSBuild files (visual studio sln) from the command line in Mono?
MsbuildMonoMsbuild Problem Overview
Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?
Msbuild Solutions
Solution 1 - Msbuild
Current status (Mono 2.10, 2011): xbuild is now able to build all versions of Visual Studio / MSBuild projects, including .sln files. Simply run xbuild
just as you would execute msbuild
on Microsoft .Net Framework. You don't need Monodevelop installed, xbuild comes with the standard Mono installation.
If your build uses custom tasks, they should still work if they don't depend on Windows executables (such as rmdir
or xcopy
).
When you are editing project files, use standard Windows path syntax - they will be converted by xbuild, if necessary. One important caveat to this rule is case sensitivity - don't mix different casings of the same file name. If you have a project that does this, you can enable compatibility mode by invoking MONO_IOMAP=case xbuild foo.sln
(or try MONO_IOMAP=all
). Mono has a page describing more advanced MSBuild project porting techniques.
Mono 2.0 answer (2008): http://www.mono-project.com/Microsoft.Build">xbuild</a> is not yet complete (it works quite well with VS2005 .csproj files, has problems with VS2008 .csproj and does not handle .sln). Mono 2.1 plans to merge the code base of mdtool (MonoDevelop command line build engine) into it, but currently http://www.monodevelop.com/MonoDevelop_1.0_Released#Command_line_tools">mdtool</a> is a better choice. mdtool build -f:project.sln
or http://ubuntu.dustinkirkland.com/manpages/intrepid/man1/mdtool.html">`man mdtool` if you have MonoDevelop installed.
Solution 2 - Msbuild
for now as per August 2017 we can use
msbuild
command as xbuild is depreciated.
Solution 3 - Msbuild
xbuild now supports solutions and projects, both VS2005 and VS2008.
Solution 4 - Msbuild
I think you are looking for xbuild: http://www.mono-project.com/Microsoft.Build