Creating ConsoleApplication for Mac on a Mac

SunnyTheOne 1 Reputation point

Hi Community

I just created a Project (Console Application) with aprox. 3000 Codelines and I'm super happy. I did this on Visual Studio for Mac. For my Windows PC I can create a .exe File. So far so good.

But I can't find any how to's / step by step tutorials on how I can create a native mac console application from my mac for my mac? The only thing I find is a tutorial how to create a Mac Form Application... but that's not what I wanted to do.

Many thanks for you input.

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
1,000 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rob Caplan - MSFT 4,862 Reputation points Microsoft Employee

    Visual Studio for Mac includes a .Net Console App template under Web and Console / App / Console Application.

    Tutorial: Create a .NET console application using Visual Studio for Mac

    It doesn't sound like this is what you're looking for, but if you want to call MacOS API via the Xamarin.Mac bindings see:
    Xamarin.Mac bindings in console apps

    0 comments No comments

  2. Bruce ( 36,421 Reputation points

    Just like other Mac languages node, python, ruby, etc you run them with a program. Fortunately, dotnet builds a small executable, that loads and runs your .net code.

    to create a console app:

    dotnet new console

    If you build and look in the bin folder, there should be file with no extension named after the project (Unix does use a file extension for executables). This is the exe, it will load the dlls in the folder and call main. The build also adds the execute bit to this file.

    Note: Currently build to native is only supported for IOS, but may appear in future versions.

    0 comments No comments