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.

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

Runtime detection

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

c:\windows\mono\mono-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:\windows\mono\mono-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

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.

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:

wine nunit-console.exe System.Drawing_test_net_2_0.dll

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.