Mono For Mac

Mono is an open-source and cross-platform implementation of the .NET Framework. Wine can use a Windows build of Mono to run .NET applications.

In the same boat. Originally it started because I suddenly got a Mac Connection mismatch between Mono versions. My VS 2017 was suddenly looking for 5.18 and my Mac had 5.16 even though I have been coding on it all day. Mono is a software platform designed to allow developers to easily create cross platform applications. You may want to check out more software for Mac, such as MonoDevelop, Resound or Aquamacs, which might be related to Mono.

Installing

For Wine releases 1.5.3 and later, the Wine-Mono package is recommended. For earlier versions, an official Windows release of Mono 2.10 is recommended.

Wine 1.5.6 and later will install Wine-Mono automatically as needed. It will search for the MSI in the following locations:

  • The Unix directory stored in the 'MonoCabDir' value at HKCUSoftwareWineDotnet.
  • /usr/share/wine/mono, or possibly some substitution for /usr if Wine was installed to a different location.
  • wine_build_directory/../mono, if Wine is being run from a build tree.
  • Download from http://dl.winehq.org/wine/wine-mono/.


Unlike gecko, there is only one package containing the code for both x86 and x86_64, as most of the code does not depend on the architecture.

The Mono package should always be removed before installing native .NET. This can be done with the following command-line:

In a 64 bit wineprefix, substitute wine64 for wine in the above command

Building

For build instructions, see the readme at https://github.com/madewokherd/wine-mono

Debugging

As of Wine Mono 0.0.4, the WINE_MONO_TRACE environment variable may be set as follows to trace calls within Mono:

This option is the same as the --trace option in Mono.

Note that 'All assemblies' includes the program itself and all libraries shipped with it. Mono is capable of tracing any .NET code. You probably should avoid the 'all' trace if there might be proprietary code running in the process.

Activating any trace at all, even a bogus assembly name, will cause Mono to print out all exceptions as they occur. This can be useful, but it can also be misleading as some exceptions are perfectly normal.

Mono For Mac

If you're not sure which libraries might be involved in a problem, and no exceptions are being raised, try WINE_MONO_TRACE=wrapper. It tends to be low-traffic while also containing useful information.

In earlier versions of Wine, the 'MONO_TRACE' environment variable may work.

If you see 'Stacktrace:' in the console, this means that Mono has crashed. To debug, set MONO_DEBUG=suspend-on-sigsegv. You will then see 'Received SIGSEGV, suspending...' after the crash, and you can attach winedbg to the process.

Documentation

Standard .NET namespaces and classes are documented at MSDN here: http://msdn.microsoft.com/en-us/library/w0x726c2.aspx

Runtime detection

As of 1.3.7, Wine will search for a Windows install of Mono in the following locations:

  • c:windowsmonomono-1.0 or mono-2.0
  • If Wine is installed, <prefix>/share/wine/mono/mono-1.0 or mono-2.0, where <prefix> is usually /usr or /usr/local.
  • If Wine is run from a build tree, wine/../mono/mono-1.0 or mono-2.0
  • The path specified in the registry, if Mono was installed via the official Windows installer.

The Wine Mono package installs its files in c:windowsmonomono-2.0. In modern Wine (>= 1.5.6), without Wine Mono installed it will appear to Windows applications that .NET is not installed, so the only real option is to use that package.

Test Suite

See http://www.mono-project.com/Testing first.

Running the Mono test suite on Wine is very important for fixing bugs (in Mono and in Wine), and I suspect that MS .NET hosted in Wine will also benefit from some of the fixes made for the Mono tests.

The Mono build system has make targets for running tests, but using them on Windows or Wine requires building Mono with cygwin or doing strange things to the build system. To make this easier, the build script for wine-mono will create self-contained builds of the Mono test suite when run with the -t switch. These tests are located in directories named like tests-net_2_0.

Mono Framework Download

To run tests, run nunit-console.exe with the dll file containing the tests as an argument. For example, to run the System.Drawing tests:

You could also invoke nunit-console.exe using Mono, or on a Windows machine from a command prompt. NUnit is actually a general-purpose unit testing framework for .NET, which Mono happens to use, and it should work on any .NET impelementation.

You can use the /fixture or /run switches to run only a single related set or tests or a single test.

Note that the tests are marked based on whether they are expected to work on various platforms, and running them in this way will include tests that are known not to work in Mono. One would have to use the /exclude switch to change this.

Microsoft .NET

If you need to use Microsoft's implementation of the .NET framework, the Microsoft runtimes can partly run on Wine. You can find tips and share comments with other users at the .NET AppDB page.

You can install the appropriate version of Microsoft's .NET runtime (dotnet35, dotnet30, dotnet20, or dotnet11) through winetricks. Be aware though, that your .NET application still might not work (at least not yet), and Microsoft's .NET runtimes are not free software so be sure to read the EULA before accepting. Mono, on the other hand, is free software, supported by a strong community, and probably a better choice if it works with your application.

Retrieved from 'https://wiki.winehq.org/index.php?title=Mono&oldid=2544'
  • Latest Version:

  • Requirements:

    Mac OS X 10.7 or later

  • Author / Product:

    Mono Team / Mono for Mac

  • Old Versions:

  • Filename:

    MonoFramework-MDK-5.18.1.0.macos10.xamarin.universal.pkg

Mono For Mac Uninstall

Mono for Mac is a software platform designed to allow developers to easily create cross platform applications part of the .NET Foundation. Sponsored by Microsoft, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for the development of cross platform applications. Mono has support for both 32 and 64 bit systems on a number of architectures as well as a number of operating systems.
After you get Mono installed, it’s probably a good idea to run a quick Hello World program to make sure everything is set up properly. That way you’ll know that your Mono for Mac is working before you try writing or running a more complex application. The Mono project focuses on compilers and runtime libraries and does not directly provide an IDE. Developers must choose from a series of available tools the one best suited for them. MonoDevelop is a Mono/C# Integrated Development Environment for Windows, Linux and macOS. It parses your C# and VB programs as you type them and is able to provide contextual completion of methods.
Pick an installation directory where you want your new copy of Mono to be installed. Let's call that location PREFIX. Your Mono installation and its dependencies will be installed there. For example, I like to use the directory /opt/mono, so I would replace PREFIX with /opt/mono in the following discussion.
If you have more than one Mono installation (for example to keep multiple versions around), you will want to read the document on Parallel Mono Environments on how to keep your various Mono installations separate.
Also Available: Download Mono for Windows