Doralitze
Doralitze

Reputation: 192

How to compile mono projects from command line on mac

I'm required to compile a C# project from the command line (not from within the IDE). It works just fine under linux (to be exact under Fedora and Ubuntu). I just install the mono-xbuild package and the build script is capable of executing the xbuild command. The problem is that there's no xbuild or mdtool inside the home-brew repositories and installing xamarin studio while building isn't the solution because it places the binary in different places depending on a whole range of conditions. How do I get my build/install script to work out of the box under MacOSX?

Upvotes: 2

Views: 3497

Answers (1)

kenorb
kenorb

Reputation: 166319

You need to install .NET for macOS, then use a dotnet command to run compile and execute a .NET project.

Here are the commands to run a Hello World's app:

dotnet new console -o myApp
cd myApp
dotnet run

For Mono apps, you need to install Mono framework (available as a Mac .pkg file)

Consider also installing MSBuild (The Microsoft Build Engine). It requires OpenSSL (install via: brew install openssl). See: Building Testing and Debugging on .Net Core MSBuild.

Upvotes: 2

Related Questions