How can you use Mono's mcs to compile and run a csproj file?

Kevin Burke picture Kevin Burke · Dec 1, 2012 · Viewed 29.6k times · Source

I'm a Unix guy who needs to try and compile some C# code for work. I've downloaded Mono for Mac, and the mcs command line tool. There's a csproj file attached to this library which contains XML with all of the files I need to compile.

Can Mono/mcs read this csproj file and generate a DLL from it?

Answer

Greg Najda picture Greg Najda · Dec 2, 2012

If you don't want to use MonoDevelop and want to use the command-line, you can use xbuild. xbuild is the Mono equivalent of MSBuild.

xbuild /p:Configuration=Release HelloWorld.csproj