Programs Like Visual Studio For Mac

Some of my other articles about Visual Studio Code :

Grab the Bits

In general terms Visual Studio for Mac is an integrated Macintosh development environment for C# and F# applications that run on iOS, Android, and Mac targets, with a variety of application forms.

Install Visual Studio Code and ASP.NET 5 for OSX. The Visual Studio installer is straight-forward, but make sure you read the release notes on how to install ASP.NET 5 on a Mac.

Once everything installed, run this command:

You will see the following options :

Select a “Console Application” using your up and down arrow keys and give it a name. It will scaffold the project for you.

Studio

Notice that it is asking you to run a couple of commands :

The last command dnx . run is for Console Applications only.

If we list out the files contained in our Console application before running the restore command, then we’ll only see two files and one is hidden:

C++
  • Program.cs
  • project.json
  • .gitignore (hidden)

Change into the directory that has your console app and run the dnu restore command and you now have a project.lock.json file.

Run the dnu build command and you see several error messages.

Note: You can safely ignore these for this release.

Type dnx . run and the Program.cs file will display “Hello World” in the terminal.

Switch over to Visual Studio Code

Navigate to your Console Project and open it in Visual Studio Code or you can simply type “code .” if your already inside the directory that you want opened.

You can run the app by pressing CMD-Shift-P and selecting “Run”. This will open a terminal window that displays “Hello World”.

Digging Deeper

We actually want to build and debug our app, so switch over to Program.cs and press CMD-Shift-B to build our app and you will be asked to configure the Task Runner. Copy and Paste the following text into the file that it opens. (called tasks.json)

This tells the editor to use xbuild instead of msbuild, since we are on a Mac.

If you switch back to Program.cs and hit Control-Shift-B again, then nothing will happen.

Select a line that you wish to debug(1) and press the “Debug Icon”(2) and finally hit the “Play button” (3).

You’ll see a message that asks you to setup the launch configuration for your app.

Switch back over to the files view and you will see a launch.json. Replace the contents with the following:

Now we’ve declared this as a mono project and gave it a program name to the executable. If we try to debug the application now, it will say :

Taking a look at the output window, we will see :

We are Missing the .csproj file!

Programs Like Visual Studio For Mac

Visual studio for mac download

We simply need to create a file and call it ConsoleApplication.csproj. I opened a ConsoleProject with Visual Studio and used the following code:

Now press CMD-Shift-B to build your project. You will see the following files have been created.

Put a break point on the Console.ReadLine() Method and try debugging the application again. You will now be able to “Step Over”, “Step In”, “Step Out”, “Continue” and “Stop” your console application.

You will also have a terminal window appear that shows the output so far :

Tweak the boilerplate code if you want to examine how the debugger validates what type a var is, etc. I also thought it was interesting that I could make my Mac beep with the Console.Beep() command even though the compiler says that it is not available in dnxcore50.

Like this Post?

As always, thanks for reading and smash one of those share buttons to give this post some love if you found it helpful. Also, feel free to leave a comment below.

Use Visual Studio 2019 to target Windows, Linux, Android, and iOS to create apps, games, and more, taking advantage of market-leading debugging and productivity tools to get work done quickly.

C/C++ is NOT supported on Visual Studio for Mac.

To see what languages are supported, click here

CMake, Clang, mingw, and more

Open a codebase from any environment and get to work right away. Use MSBuild with the Microsoft Visual C++ compiler or a 3rd party toolset like CMake with Clang or mingw to build and debug your code right in the IDE. Benefit from a first-class CMake experience.

The best way to target Windows

Design and build classic Windows desktop programs or Universal Windows apps targeting HoloLens, Surface Hub, PC, and Xbox with the Microsoft Visual C++ toolset and the Visual Studio 2019.

Build apps using C++11, C++14, and C++17

Enjoy support for C++11, C++14 and many C++17 features with market leading performance, build throughput and security. Write code using the power of generic lambda expressions, resumable functions, decltype (auto), extended constexpr and C++ attributes, fold expressions, noexcept in type system, inline variables and other modern features.

Write Linux apps and debug them in real-time

Take advantage of powerful coding and debugging tools to manage code targeting Linux built with GCC, Clang, or another compiler. Debug your Linux applications as they run remotely with GDB. Whether you are building IoT apps or high-performance computing cloud services for Linux, Visual Studio will help you be productive.

Target Android and iOS while staying productive

Leverage the power of Visual Studio 2019 and the debugger to build high-performance Android and/or iOS apps and games in C++, share C++ libraries to target both mobile platforms and Windows, or write once and run across all mobile platforms with Xamarin and C++.

Join the many AAA top game studios already using Visual Studio

Create high-performance games with DirectX to run on Windows devices, or build cross-platform games with a top game engine, such as Unity, Unreal, and Cocos. Join the many wildly-successful game studios that already use Visual Studio to boost your productivity with Visual Studio 2019 and the world-class debugger.

Write the best, bug-free code

Do all the basics like setting breakpoints and stepping through your code, then get more advanced with variable visualization, performance profiling, debugging any local or remote process, and multi-threaded application debugging. Run to click, edit your live code and continue executing without having to rebuild.

Browse, edit, and improve your code quickly

Visualize your code with syntax colorization, guidelines, code tooltips, Class View, or Call Hierarchy. Navigate to any code symbol by reference, definition, declaration, and more. Autocomplete your code as you type, quickly repair problems, and refactor your code to your needs. Analyze your code for common issues. Save time that could be better spent.

Visual Studio For Mac Professional

Free, fully-featured IDE for students, open-source and individual
developers

Professional developer tools, services, and subscription benefits for small
teams

End-to-end solution to meet demanding quality and scale needs of teams of all
sizes