Menu
-->![Mono project mac Mono project mac](/uploads/1/2/4/6/124631220/202563250.jpg)
The most popular versions of Mono for Mac are 2.1 and 2.0. Our built-in antivirus scanned this Mac download and rated it as virus free. Mono for Mac lies within Developer Tools, more precisely IDE. The actual developer of this free Mac application is mono-project. 11 votes, 47 comments. Hi all, Does any of you use Linux or Mac for enterprise C# development? I heard about the Mono project but wonder how. Most users would be using the MonoDevelop IDE to create their projects. You will have a choice of GUI toolkits for building your application, from pure cross platform, to Mac-specific using MonoMac. 32 and 64 bit support. The Mono packages published on this web site provide both a 32-bit and a 64-bit Mono VM. Mono Project gathers everything necessary to both run and develop applications based on.NET Framework on Mac OS X: Moma, an assistant that makes it easier to migrate applications, and MonoDevelop, an integrated development environment. Note For Mac OS X 10.4 or later, including Leopard. Mono open source ECMA CLI, C# and.NET implementation. Android ios xamarin csharp runtime dotnet jit C# 3,474 8,883 1,784 (28 issues need help) 91 Updated Sep 29, 2020.
Xamarin.Mac | Mono
Xamarin.Forms now has preview support for GTK# apps. GTK# is a graphical user interface toolkit that links the GTK+ toolkit and a variety of GNOME libraries, allowing the development of fully native GNOME graphics apps using Mono and .NET. This article demonstrates how to add a GTK# project to a Xamarin.Forms solution.
Important
Xamarin.Forms support for GTK# is provided by the community. For more information, see Xamarin.Forms Platform Support.
Before you start, create a new Xamarin.Forms solution, or use an existing Xamarin.Forms solution, for example, GameOfLife.
Note
While this article focuses on adding a GTK# app to a Xamarin.Forms solution in VS2017 and Visual Studio for Mac, it can also be performed in MonoDevelop for Linux.
Adding a GTK# App
GTK# for macOS and Linux is installed as part of Mono. GTK# for .NET can be installed on Windows with the GTK# Installer.
Follow these instructions to add a GTK# app that will run on the Windows desktop:
- In Visual Studio 2019, right-click on the solution name in Solution Explorer and choose Add > New Project...
- In the New Project window, at the left select Visual C# and Windows Classic Desktop. In the list of project types, choose Class Library (.NET Framework), and ensure that the Framework drop-down is set to a minimum of .NET Framework 4.7.
- Type a name for the project with a GTK extension, for example GameOfLife.GTK. Click the Browse button, select the folder containing the other platform projects, and press Select Folder. This will put the GTK project in the same directory as the other projects in the solution.Press the OK button to create the project.
- In the Solution Explorer, right click the new GTK project and select Manage NuGet Packages. Select the Browse tab, and search for Xamarin.Forms 3.0 or greater.Select the package and click the Install button.
- Now search for the Xamarin.Forms.Platform.GTK 3.0 package or greater.Select the package and click the Install button.
- In the Solution Explorer, right-click the solution name and select Manage NuGet Packages for Solution. Select the Update tab and the Xamarin.Forms package. Select all the projects and update them to the same Xamarin.Forms version as used by the GTK project.
- In the Solution Explorer, right-click on References in the GTK project. In the Reference Manager dialog, select Projects at the left, and check the checkbox adjacent to the .NET Standard or Shared project:
- In the Reference Manager dialog, press the Browse button and browse to the C:Program Files (x86)GtkSharp2.12lib folder and select the atk-sharp.dll, gdk-sharp.dll, glade-sharp.dll, glib-sharp.dll, gtk-dotnet.dll, gtk-sharp.dll files.Press the OK button to add the references.
- In the GTK project, rename Class1.cs to Program.cs.
- In the GTK project, edit the Program.cs file so that it resembles the following code:This code initializes GTK# and Xamarin.Forms, creates an application window, and runs the app.
- In the Solution Explorer, right click the GTK project and select Properties.
- In the Properties window, select the Application tab and change the Output type drop-down to Windows Application.
- In the Solution Explorer, right-click the GTK project and select Set as Startup Project. Press F5 to run the program with the Visual Studio debugger on the Windows desktop:
Follow these instructions to add a GTK# app that will run on the Mac desktop:
![Mono project mac Mono project mac](/uploads/1/2/4/6/124631220/202563250.jpg)
- In Visual Studio for Mac, right-click on the Xamarin.Forms solution and choose Add > Add New Project...
- In the New Project window choose Other > .NET > Gtk# 2.0 Project and press Next.
- Type a name for the project with a GTK extension, for example GameOfLife.GTK, and press Create.
- In the Solution Pad, right-click on Packages > Add Packages.. for the GTK project, and add the Xamarin.Forms 3.0 pre-release NuGet package or greater.
- In the Solution Pad, right-click on Packages > Add Packages.. for the GTK project, and add the Xamarin.Forms.Platform.GTK 3.0 pre-release NuGet package or greater.
- Update the other platform projects to use the same Xamarin.Forms version as used by the GTK project.
- In the Solution Pad, right-click on References > Edit References.. for the GTK project, and add a reference to the Xamarin.Forms project (either .NET Standard or Shared Project).
- Edit the Program.cs file of the GTK project so that it resembles the following code:This code initializes GTK# and Xamarin.Forms, creates an application window, and runs the app.
- In the Solution Pad, right-click the GTK project and select Set as Startup Project.
- In the Visual Studio for Mac toolbar, press the Start button (the triangular button that resembles a Play button) to launch the app.
Next Steps
Platform Specifics
You can determine what platform your Xamarin.Forms application is running on from either XAML or code. This allows you to change program characteristics when it's running on GTK#. In code, compare the value of
Device.RuntimePlatform
with the Device.GTK
constant (which equals the string 'GTK'). If there's a match, the application is running on GTK#.In XAML, you can use the
OnPlatform
tag to select a property value specific to the platform:See All Results For This Question
Application Icon
You can set the app icon at startup:
Themes
There are a wide variety of themes available for GTK#, and they can be used from a Xamarin.Forms app:
GTK# Platform Setup - Xamarin | Microsoft Docs
Native Forms
Native Forms allows Xamarin.Forms
ContentPage
-derived pages to be consumed by native projects, including GTK# projects. This can be accomplished by creating an instance of the ContentPage
-derived page and converting it to the native GTK# type using the CreateContainer
extension method:For more information about Native Forms, see Native Forms.
Issues
This is a Preview, so you should expect that not everything is production ready. For the current implementation status, see Status, and for the current known issues, see Pending & Known Issues.