42

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?

Kevin Burke
  • 61,194
  • 76
  • 188
  • 305

4 Answers4

66

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
Greg Najda
  • 1,025
  • 9
  • 13
4

The easiest way is to head over to monodevelop and download their IDE. It can open project files generated by Visual Studio.

Now you can also use the convenience of aptitude as below:

sudo apt-get install monodevelop mono-gmcs
vidstige
  • 12,492
  • 9
  • 66
  • 110
3

This question is old and answers are deprectated. I succeed to generate and run DLL from a csproj by following theses steps:

Then, use dotnet build YourProject.csproj to compile the project and dotnet run YourProject.csproj to run it.

Benjamin Lucidarme
  • 1,648
  • 1
  • 23
  • 39
1

For Ubuntu, and probably other Debian-based distributions:

sudo apt-get install monodevelop mono-gmcs

(mono-gmcs may be needed to compile .net 2.0 or 3.5 projects)

mivk
  • 13,452
  • 5
  • 76
  • 69