Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?
Is it possible to build MSBuild files (visual studio sln) from the command line in Mono
monomsbuild
Related Topic
- Visual-studio – Get Visual Studio to run a T4 Template on every build
- Microsoft.WebApplication.targets was not found, on the build server. What’s your solution
- .net – Differences between Visual Studio (.sln) build runner and MSBuild
- Visual-studio – What parameters does Visual Studio pass to MSBuild
- Does MSbuild require Visual Studio to be installed on the build server
- How to build .NET 4.6 Framework app without Visual Studio installed
- Visual-studio – Differences between Visual Studio Build step and MSBuild Build step
- How to install the VS2017 version of msbuild on a build server without installing the IDE
Best Answer
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 executemsbuild
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
orxcopy
).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 tryMONO_IOMAP=all
). Mono has a page describing more advanced MSBuild project porting techniques.Mono 2.0 answer (2008):
xbuild 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 mdtool is a better choice.mdtool build -f:project.sln
orman mdtool
if you have MonoDevelop installed.